h264: Don't set num_slices anymore
The num_slices parameter was improperly set to the number of reference frames, which is incorrect. Add a counter for the number of slices per surface, and set num_slices to that value. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
This commit is contained in:
+3
-2
@@ -207,6 +207,7 @@ static void h264_fill_dpb(struct cedrus_data *data,
|
|||||||
|
|
||||||
static void h264_va_picture_to_v4l2(struct cedrus_data *driver_data,
|
static void h264_va_picture_to_v4l2(struct cedrus_data *driver_data,
|
||||||
struct object_context *context,
|
struct object_context *context,
|
||||||
|
struct object_surface *surface,
|
||||||
VAPictureParameterBufferH264 *VAPicture,
|
VAPictureParameterBufferH264 *VAPicture,
|
||||||
struct v4l2_ctrl_h264_decode_param *decode,
|
struct v4l2_ctrl_h264_decode_param *decode,
|
||||||
struct v4l2_ctrl_h264_pps *pps,
|
struct v4l2_ctrl_h264_pps *pps,
|
||||||
@@ -214,7 +215,7 @@ static void h264_va_picture_to_v4l2(struct cedrus_data *driver_data,
|
|||||||
{
|
{
|
||||||
h264_fill_dpb(driver_data, context, decode);
|
h264_fill_dpb(driver_data, context, decode);
|
||||||
|
|
||||||
decode->num_slices = VAPicture->num_ref_frames;
|
decode->num_slices = surface->slices_count;
|
||||||
decode->top_field_order_cnt = VAPicture->CurrPic.TopFieldOrderCnt;
|
decode->top_field_order_cnt = VAPicture->CurrPic.TopFieldOrderCnt;
|
||||||
decode->bottom_field_order_cnt = VAPicture->CurrPic.BottomFieldOrderCnt;
|
decode->bottom_field_order_cnt = VAPicture->CurrPic.BottomFieldOrderCnt;
|
||||||
|
|
||||||
@@ -420,7 +421,7 @@ int h264_set_controls(struct cedrus_data *driver_data,
|
|||||||
|
|
||||||
dpb_update(context, &surface->params.h264.picture);
|
dpb_update(context, &surface->params.h264.picture);
|
||||||
|
|
||||||
h264_va_picture_to_v4l2(driver_data, context,
|
h264_va_picture_to_v4l2(driver_data, context, surface,
|
||||||
&surface->params.h264.picture,
|
&surface->params.h264.picture,
|
||||||
&decode, &pps, &sps);
|
&decode, &pps, &sps);
|
||||||
h264_va_matrix_to_v4l2(driver_data, context,
|
h264_va_matrix_to_v4l2(driver_data, context,
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ static VAStatus codec_store_buffer(struct cedrus_data *driver_data,
|
|||||||
buffer_object->size * buffer_object->count);
|
buffer_object->size * buffer_object->count);
|
||||||
surface_object->slices_size +=
|
surface_object->slices_size +=
|
||||||
buffer_object->size * buffer_object->count;
|
buffer_object->size * buffer_object->count;
|
||||||
|
surface_object->slices_count++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VAPictureParameterBufferType:
|
case VAPictureParameterBufferType:
|
||||||
|
|||||||
@@ -161,6 +161,7 @@ VAStatus SunxiCedrusCreateSurfaces(VADriverContextP context, int width,
|
|||||||
|
|
||||||
memset(&surface_object->params, 0,
|
memset(&surface_object->params, 0,
|
||||||
sizeof(surface_object->params));
|
sizeof(surface_object->params));
|
||||||
|
surface_object->slices_count = 0;
|
||||||
surface_object->slices_size = 0;
|
surface_object->slices_size = 0;
|
||||||
|
|
||||||
surface_object->request_fd = -1;
|
surface_object->request_fd = -1;
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ struct object_surface {
|
|||||||
unsigned int destination_buffers_count;
|
unsigned int destination_buffers_count;
|
||||||
|
|
||||||
unsigned int slices_size;
|
unsigned int slices_size;
|
||||||
|
unsigned int slices_count;
|
||||||
|
|
||||||
union {
|
union {
|
||||||
struct {
|
struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user