@@ -152,20 +152,6 @@ read_value_uint32(FILE* fp, const char* field_name, uint32_t* value)
152
152
return 0 ;
153
153
}
154
154
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
-
169
155
static VAStatus
170
156
create_surface (VASurfaceID * p_surface_id,
171
157
uint32_t width, uint32_t height,
@@ -524,10 +510,10 @@ bool read_frame_to_surface(FILE *fp, VASurfaceID surface_id)
524
510
525
511
int i = 0 ;
526
512
527
- int frame_size = 0 , y_size = 0 , u_size = 0 ;
513
+ int frame_size = 0 , y_size = 0 ;
528
514
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 ;
531
517
532
518
int bytes_per_pixel = 2 ;
533
519
size_t n_items;
@@ -554,7 +540,6 @@ bool read_frame_to_surface(FILE *fp, VASurfaceID surface_id)
554
540
case VA_FOURCC_P010:
555
541
frame_size = va_image.width * va_image.height * bytes_per_pixel * 3 / 2 ;
556
542
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 );
558
543
559
544
src_buffer = (unsigned char *)malloc (frame_size);
560
545
assert (src_buffer);
@@ -629,10 +614,10 @@ bool write_surface_to_frame(FILE *fp, VASurfaceID surface_id)
629
614
630
615
int i = 0 ;
631
616
632
- int frame_size = 0 , y_size = 0 , u_size = 0 ;
617
+ int frame_size = 0 , y_size = 0 ;
633
618
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 ;
636
621
637
622
int bytes_per_pixel = 2 ;
638
623
@@ -664,7 +649,6 @@ bool write_surface_to_frame(FILE *fp, VASurfaceID surface_id)
664
649
dst_buffer = (unsigned char *)malloc (frame_size);
665
650
assert (dst_buffer);
666
651
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 );
668
652
y_dst = dst_buffer;
669
653
u_dst = dst_buffer + y_size; // UV offset for P010
670
654
y_src = (unsigned char *)in_buf + va_image.offsets [0 ];
0 commit comments