Skip to content

Commit 30da35a

Browse files
committed
clean some unused variables and functions
some variables was defined but not used. some static functions was defined but not used. Signed-off-by: Carl Zhang <[email protected]>
1 parent 7adaf8b commit 30da35a

File tree

4 files changed

+7
-45
lines changed

4 files changed

+7
-45
lines changed

encode/av1encode.c

+1-21
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,6 @@ static pthread_mutex_t encode_mutex = PTHREAD_MUTEX_INITIALIZER;
527527
static pthread_cond_t encode_cond = PTHREAD_COND_INITIALIZER;
528528
static pthread_t encode_thread;
529529

530-
static char *coded_fn = NULL;
531530
static FILE *coded_fp = NULL, *srcyuv_fp = NULL, *recyuv_fp = NULL;
532531
static unsigned long long srcyuv_frames = 0;
533532
static int srcyuv_fourcc = VA_FOURCC_IYUV;
@@ -569,22 +568,6 @@ static unsigned int GetTickCount()
569568
return tv.tv_usec / 1000 + tv.tv_sec * 1000;
570569
}
571570

572-
static char *fourcc_to_string(int fourcc)
573-
{
574-
switch (fourcc) {
575-
case VA_FOURCC_NV12:
576-
return "NV12";
577-
case VA_FOURCC_IYUV:
578-
return "IYUV";
579-
case VA_FOURCC_YV12:
580-
return "YV12";
581-
case VA_FOURCC_UYVY:
582-
return "UYVY";
583-
default:
584-
return "Unknown";
585-
}
586-
}
587-
588571
static int string_to_fourcc(char *str)
589572
{
590573
CHECK_NULL(str);
@@ -1831,10 +1814,7 @@ pack_error_resilient(bitstream* bs)
18311814
static void
18321815
pack_ref_frame_flags(bitstream* bs, uint8_t error_resilient_mode, uint8_t isI)
18331816
{
1834-
uint8_t primary_ref_frame = PRIMARY_REF_NONE;
1835-
if(isI || error_resilient_mode)
1836-
primary_ref_frame = PRIMARY_REF_NONE;
1837-
else
1817+
if(!(isI || error_resilient_mode))
18381818
put_ui(bs, 0, 3); //primary_ref_frame
18391819
if (!(fh.frame_type == SWITCH_FRAME || (fh.frame_type == KEY_FRAME && fh.show_frame)))
18401820
put_ui(bs, fh.refresh_frame_flags, NUM_REF_FRAMES);

encode/vp8enc.c

-1
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,6 @@ void vp8enc_create_EncoderPipe()
677677
{
678678
VAEntrypoint entrypoints[5];
679679
int num_entrypoints;
680-
int i;
681680
VAConfigAttrib conf_attrib[2];
682681
VASurfaceAttrib surface_attrib;
683682
int major_ver, minor_ver;

videoprocess/vpp3dlut.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,6 @@ video_frame_process_scaling(VASurfaceID in_surface_id,
11851185
VAProcPipelineParameterBuffer pipeline_param;
11861186
VARectangle surface_region, output_region;
11871187
VABufferID pipeline_param_buf_id = VA_INVALID_ID;
1188-
VABufferID filter_param_buf_id = VA_INVALID_ID;
11891188

11901189
/* Fill pipeline buffer */
11911190
surface_region.x = 0;

videoprocess/vpphdr_tm.cpp

+6-22
Original file line numberDiff line numberDiff line change
@@ -152,20 +152,6 @@ read_value_uint32(FILE* fp, const char* field_name, uint32_t* value)
152152
return 0;
153153
}
154154

155-
static int8_t
156-
read_value_float(FILE *fp, const char* field_name, float* value)
157-
{
158-
char str[MAX_LEN];
159-
if (read_value_string(fp, field_name, str)) {
160-
printf("Failed to find float field: %s \n", field_name);
161-
return -1;
162-
}
163-
164-
*value = atof(str);
165-
166-
return 0;
167-
}
168-
169155
static VAStatus
170156
create_surface(VASurfaceID * p_surface_id,
171157
uint32_t width, uint32_t height,
@@ -524,10 +510,10 @@ bool read_frame_to_surface(FILE *fp, VASurfaceID surface_id)
524510

525511
int i = 0;
526512

527-
int frame_size = 0, y_size = 0, u_size = 0;
513+
int frame_size = 0, y_size = 0;
528514

529-
unsigned char *y_src = NULL, *u_src = NULL, *v_src = NULL;
530-
unsigned char *y_dst = NULL, *u_dst = NULL, *v_dst = NULL;
515+
unsigned char *y_src = NULL, *u_src = NULL;
516+
unsigned char *y_dst = NULL, *u_dst = NULL;
531517

532518
int bytes_per_pixel = 2;
533519
size_t n_items;
@@ -554,7 +540,6 @@ bool read_frame_to_surface(FILE *fp, VASurfaceID surface_id)
554540
case VA_FOURCC_P010:
555541
frame_size = va_image.width * va_image.height * bytes_per_pixel * 3 / 2;
556542
y_size = va_image.width * va_image.height * bytes_per_pixel;
557-
u_size = (va_image.width / 2 * bytes_per_pixel) * (va_image.height >> 1);
558543

559544
src_buffer = (unsigned char*)malloc(frame_size);
560545
assert(src_buffer);
@@ -629,10 +614,10 @@ bool write_surface_to_frame(FILE *fp, VASurfaceID surface_id)
629614

630615
int i = 0;
631616

632-
int frame_size = 0, y_size = 0, u_size = 0;
617+
int frame_size = 0, y_size = 0;
633618

634-
unsigned char *y_src = NULL, *u_src = NULL, *v_src = NULL;
635-
unsigned char *y_dst = NULL, *u_dst = NULL, *v_dst = NULL;
619+
unsigned char *y_src = NULL, *u_src = NULL;
620+
unsigned char *y_dst = NULL, *u_dst = NULL;
636621

637622
int bytes_per_pixel = 2;
638623

@@ -664,7 +649,6 @@ bool write_surface_to_frame(FILE *fp, VASurfaceID surface_id)
664649
dst_buffer = (unsigned char*)malloc(frame_size);
665650
assert(dst_buffer);
666651
y_size = va_image.width * va_image.height * bytes_per_pixel;
667-
u_size = (va_image.width / 2 * bytes_per_pixel) * (va_image.height >> 1);
668652
y_dst = dst_buffer;
669653
u_dst = dst_buffer + y_size; // UV offset for P010
670654
y_src = (unsigned char*)in_buf + va_image.offsets[0];

0 commit comments

Comments
 (0)