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 <carl.zhang@intel.com>
This commit is contained in:
Carl Zhang 2023-12-05 04:13:26 -05:00 committed by Zhang, Xinfeng
parent 7adaf8bbfb
commit 30da35aaa3
4 changed files with 7 additions and 45 deletions

View File

@ -527,7 +527,6 @@ static pthread_mutex_t encode_mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t encode_cond = PTHREAD_COND_INITIALIZER;
static pthread_t encode_thread;
static char *coded_fn = NULL;
static FILE *coded_fp = NULL, *srcyuv_fp = NULL, *recyuv_fp = NULL;
static unsigned long long srcyuv_frames = 0;
static int srcyuv_fourcc = VA_FOURCC_IYUV;
@ -569,22 +568,6 @@ static unsigned int GetTickCount()
return tv.tv_usec / 1000 + tv.tv_sec * 1000;
}
static char *fourcc_to_string(int fourcc)
{
switch (fourcc) {
case VA_FOURCC_NV12:
return "NV12";
case VA_FOURCC_IYUV:
return "IYUV";
case VA_FOURCC_YV12:
return "YV12";
case VA_FOURCC_UYVY:
return "UYVY";
default:
return "Unknown";
}
}
static int string_to_fourcc(char *str)
{
CHECK_NULL(str);
@ -1831,10 +1814,7 @@ pack_error_resilient(bitstream* bs)
static void
pack_ref_frame_flags(bitstream* bs, uint8_t error_resilient_mode, uint8_t isI)
{
uint8_t primary_ref_frame = PRIMARY_REF_NONE;
if(isI || error_resilient_mode)
primary_ref_frame = PRIMARY_REF_NONE;
else
if(!(isI || error_resilient_mode))
put_ui(bs, 0, 3); //primary_ref_frame
if (!(fh.frame_type == SWITCH_FRAME || (fh.frame_type == KEY_FRAME && fh.show_frame)))
put_ui(bs, fh.refresh_frame_flags, NUM_REF_FRAMES);

View File

@ -677,7 +677,6 @@ void vp8enc_create_EncoderPipe()
{
VAEntrypoint entrypoints[5];
int num_entrypoints;
int i;
VAConfigAttrib conf_attrib[2];
VASurfaceAttrib surface_attrib;
int major_ver, minor_ver;

View File

@ -1185,7 +1185,6 @@ video_frame_process_scaling(VASurfaceID in_surface_id,
VAProcPipelineParameterBuffer pipeline_param;
VARectangle surface_region, output_region;
VABufferID pipeline_param_buf_id = VA_INVALID_ID;
VABufferID filter_param_buf_id = VA_INVALID_ID;
/* Fill pipeline buffer */
surface_region.x = 0;

View File

@ -152,20 +152,6 @@ read_value_uint32(FILE* fp, const char* field_name, uint32_t* value)
return 0;
}
static int8_t
read_value_float(FILE *fp, const char* field_name, float* value)
{
char str[MAX_LEN];
if (read_value_string(fp, field_name, str)) {
printf("Failed to find float field: %s \n", field_name);
return -1;
}
*value = atof(str);
return 0;
}
static VAStatus
create_surface(VASurfaceID * p_surface_id,
uint32_t width, uint32_t height,
@ -524,10 +510,10 @@ bool read_frame_to_surface(FILE *fp, VASurfaceID surface_id)
int i = 0;
int frame_size = 0, y_size = 0, u_size = 0;
int frame_size = 0, y_size = 0;
unsigned char *y_src = NULL, *u_src = NULL, *v_src = NULL;
unsigned char *y_dst = NULL, *u_dst = NULL, *v_dst = NULL;
unsigned char *y_src = NULL, *u_src = NULL;
unsigned char *y_dst = NULL, *u_dst = NULL;
int bytes_per_pixel = 2;
size_t n_items;
@ -554,7 +540,6 @@ bool read_frame_to_surface(FILE *fp, VASurfaceID surface_id)
case VA_FOURCC_P010:
frame_size = va_image.width * va_image.height * bytes_per_pixel * 3 / 2;
y_size = va_image.width * va_image.height * bytes_per_pixel;
u_size = (va_image.width / 2 * bytes_per_pixel) * (va_image.height >> 1);
src_buffer = (unsigned char*)malloc(frame_size);
assert(src_buffer);
@ -629,10 +614,10 @@ bool write_surface_to_frame(FILE *fp, VASurfaceID surface_id)
int i = 0;
int frame_size = 0, y_size = 0, u_size = 0;
int frame_size = 0, y_size = 0;
unsigned char *y_src = NULL, *u_src = NULL, *v_src = NULL;
unsigned char *y_dst = NULL, *u_dst = NULL, *v_dst = NULL;
unsigned char *y_src = NULL, *u_src = NULL;
unsigned char *y_dst = NULL, *u_dst = NULL;
int bytes_per_pixel = 2;
@ -664,7 +649,6 @@ bool write_surface_to_frame(FILE *fp, VASurfaceID surface_id)
dst_buffer = (unsigned char*)malloc(frame_size);
assert(dst_buffer);
y_size = va_image.width * va_image.height * bytes_per_pixel;
u_size = (va_image.width / 2 * bytes_per_pixel) * (va_image.height >> 1);
y_dst = dst_buffer;
u_dst = dst_buffer + y_size; // UV offset for P010
y_src = (unsigned char*)in_buf + va_image.offsets[0];