Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: h264: Store current picture fields

This information, also called picture structure, is required in field
decoding mode to construct reference lists.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Sebastian Fricke <sebastian.fricke@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Nicolas Dufresne and committed by
Mauro Carvalho Chehab
adc8a8d6 26e45205

+11 -3
+7 -3
drivers/media/v4l2-core/v4l2-h264.c
··· 34 34 cur_frame_num = dec_params->frame_num; 35 35 36 36 memset(b, 0, sizeof(*b)); 37 - if (!(dec_params->flags & V4L2_H264_DECODE_PARAM_FLAG_FIELD_PIC)) 37 + if (!(dec_params->flags & V4L2_H264_DECODE_PARAM_FLAG_FIELD_PIC)) { 38 38 b->cur_pic_order_count = min(dec_params->bottom_field_order_cnt, 39 39 dec_params->top_field_order_cnt); 40 - else if (dec_params->flags & V4L2_H264_DECODE_PARAM_FLAG_BOTTOM_FIELD) 40 + b->cur_pic_fields = V4L2_H264_FRAME_REF; 41 + } else if (dec_params->flags & V4L2_H264_DECODE_PARAM_FLAG_BOTTOM_FIELD) { 41 42 b->cur_pic_order_count = dec_params->bottom_field_order_cnt; 42 - else 43 + b->cur_pic_fields = V4L2_H264_BOTTOM_FIELD_REF; 44 + } else { 43 45 b->cur_pic_order_count = dec_params->top_field_order_cnt; 46 + b->cur_pic_fields = V4L2_H264_TOP_FIELD_REF; 47 + } 44 48 45 49 for (i = 0; i < V4L2_H264_NUM_DPB_ENTRIES; i++) { 46 50 u32 pic_order_count;
+4
include/media/v4l2-h264.h
··· 21 21 * @refs.longterm: set to true for a long term reference 22 22 * @refs: array of references 23 23 * @cur_pic_order_count: picture order count of the frame being decoded 24 + * @cur_pic_fields: fields present in the frame being decoded 24 25 * @unordered_reflist: unordered list of references. Will be used to generate 25 26 * ordered P/B0/B1 lists 26 27 * @num_valid: number of valid references in the refs array ··· 37 36 u32 pic_num; 38 37 u16 longterm : 1; 39 38 } refs[V4L2_H264_NUM_DPB_ENTRIES]; 39 + 40 40 s32 cur_pic_order_count; 41 + u8 cur_pic_fields; 42 + 41 43 struct v4l2_h264_reference unordered_reflist[V4L2_H264_REF_LIST_LEN]; 42 44 u8 num_valid; 43 45 };