mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
CHROMIUM: v4l: Add VP8 low-level decoder API controls.
These controls are to be used with the new low-level decoder API for VP8 to provide additional parameters for the hardware that cannot parse the input stream. BUG=chrome-os-partner:33728 TEST=compile Signed-off-by: Pawel Osciak <posciak@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/237670 Reviewed-by: Wu-cheng Li <wuchengli@chromium.org> Commit-Queue: Tomasz Figa <tfiga@chromium.org> Tested-by: Tomasz Figa <tfiga@chromium.org> Change-Id: I32b45e07cfe02b25ea5202d0c839699103e3b800 Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Signed-off-by: Yakir Yang <ykk@rock-chips.com>
This commit is contained in:
parent
d6b1e0763c
commit
3acde7a6c7
|
|
@ -767,6 +767,8 @@ const char *v4l2_ctrl_get_name(u32 id)
|
|||
case V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP: return "VPX P-Frame QP Value";
|
||||
case V4L2_CID_MPEG_VIDEO_VPX_PROFILE: return "VPX Profile";
|
||||
|
||||
case V4L2_CID_MPEG_VIDEO_VP8_FRAME_HDR: return "VP8 Frame Header";
|
||||
|
||||
/* CAMERA controls */
|
||||
/* Keep the order of the 'case's the same as in v4l2-controls.h! */
|
||||
case V4L2_CID_CAMERA_CLASS: return "Camera Controls";
|
||||
|
|
@ -1146,6 +1148,9 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
|
|||
case V4L2_CID_MPEG_VIDEO_H264_DECODE_PARAM:
|
||||
*type = V4L2_CTRL_TYPE_H264_DECODE_PARAM;
|
||||
break;
|
||||
case V4L2_CID_MPEG_VIDEO_VP8_FRAME_HDR:
|
||||
*type = V4L2_CTRL_TYPE_VP8_FRAME_HDR;
|
||||
break;
|
||||
default:
|
||||
*type = V4L2_CTRL_TYPE_INTEGER;
|
||||
break;
|
||||
|
|
@ -1464,6 +1469,7 @@ static int std_validate(const struct v4l2_ctrl *ctrl, u32 idx,
|
|||
case V4L2_CTRL_TYPE_H264_SCALING_MATRIX:
|
||||
case V4L2_CTRL_TYPE_H264_SLICE_PARAM:
|
||||
case V4L2_CTRL_TYPE_H264_DECODE_PARAM:
|
||||
case V4L2_CTRL_TYPE_VP8_FRAME_HDR:
|
||||
return 0;
|
||||
|
||||
default:
|
||||
|
|
@ -2030,6 +2036,9 @@ static struct v4l2_ctrl *v4l2_ctrl_new(struct v4l2_ctrl_handler *hdl,
|
|||
case V4L2_CTRL_TYPE_H264_DECODE_PARAM:
|
||||
elem_size = sizeof(struct v4l2_ctrl_h264_decode_param);
|
||||
break;
|
||||
case V4L2_CTRL_TYPE_VP8_FRAME_HDR:
|
||||
elem_size = sizeof(struct v4l2_ctrl_vp8_frame_hdr);
|
||||
break;
|
||||
default:
|
||||
if (type < V4L2_CTRL_COMPOUND_TYPES)
|
||||
elem_size = sizeof(s32);
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ struct poll_table_struct;
|
|||
* @p_h264_scal_mtrx: Pointer to a struct v4l2_ctrl_h264_scaling_matrix.
|
||||
* @p_h264_slice_param: Pointer to a struct v4l2_ctrl_h264_slice_param.
|
||||
* @p_h264_decode_param: Pointer to a struct v4l2_ctrl_h264_decode_param.
|
||||
* @p_vp8_frame_hdr: Pointer to a struct v4l2_ctrl_vp8_frame_hdr.
|
||||
* @p: Pointer to a compound value.
|
||||
*/
|
||||
union v4l2_ctrl_ptr {
|
||||
|
|
@ -63,6 +64,7 @@ union v4l2_ctrl_ptr {
|
|||
struct v4l2_ctrl_h264_scaling_matrix *p_h264_scal_mtrx;
|
||||
struct v4l2_ctrl_h264_slice_param *p_h264_slice_param;
|
||||
struct v4l2_ctrl_h264_decode_param *p_h264_decode_param;
|
||||
struct v4l2_ctrl_vp8_frame_hdr *p_vp8_frame_hdr;
|
||||
void *p;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -584,6 +584,8 @@ enum v4l2_vp8_golden_frame_sel {
|
|||
#define V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP (V4L2_CID_MPEG_BASE+510)
|
||||
#define V4L2_CID_MPEG_VIDEO_VPX_PROFILE (V4L2_CID_MPEG_BASE+511)
|
||||
|
||||
#define V4L2_CID_MPEG_VIDEO_VP8_FRAME_HDR (V4L2_CID_MPEG_BASE+512)
|
||||
|
||||
/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */
|
||||
#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
|
||||
#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0)
|
||||
|
|
@ -1118,4 +1120,96 @@ struct v4l2_ctrl_h264_decode_param {
|
|||
struct v4l2_h264_dpb_entry dpb[16];
|
||||
};
|
||||
|
||||
#define V4L2_VP8_SEGMNT_HDR_FLAG_ENABLED 0x01
|
||||
#define V4L2_VP8_SEGMNT_HDR_FLAG_UPDATE_MAP 0x02
|
||||
#define V4L2_VP8_SEGMNT_HDR_FLAG_UPDATE_FEATURE_DATA 0x04
|
||||
struct v4l2_vp8_sgmnt_hdr {
|
||||
__u8 segment_feature_mode;
|
||||
|
||||
__s8 quant_update[4];
|
||||
__s8 lf_update[4];
|
||||
__u8 segment_probs[3];
|
||||
|
||||
__u8 flags;
|
||||
};
|
||||
|
||||
#define V4L2_VP8_LF_HDR_ADJ_ENABLE 0x01
|
||||
#define V4L2_VP8_LF_HDR_DELTA_UPDATE 0x02
|
||||
struct v4l2_vp8_loopfilter_hdr {
|
||||
__u8 type;
|
||||
__u8 level;
|
||||
__u8 sharpness_level;
|
||||
__s8 ref_frm_delta_magnitude[4];
|
||||
__s8 mb_mode_delta_magnitude[4];
|
||||
|
||||
__u8 flags;
|
||||
};
|
||||
|
||||
struct v4l2_vp8_quantization_hdr {
|
||||
__u8 y_ac_qi;
|
||||
__s8 y_dc_delta;
|
||||
__s8 y2_dc_delta;
|
||||
__s8 y2_ac_delta;
|
||||
__s8 uv_dc_delta;
|
||||
__s8 uv_ac_delta;
|
||||
__u16 dequant_factors[4][3][2];
|
||||
};
|
||||
|
||||
struct v4l2_vp8_entropy_hdr {
|
||||
__u8 coeff_probs[4][8][3][11];
|
||||
__u8 y_mode_probs[4];
|
||||
__u8 uv_mode_probs[3];
|
||||
__u8 mv_probs[2][19];
|
||||
};
|
||||
|
||||
#define V4L2_VP8_FRAME_HDR_FLAG_EXPERIMENTAL 0x01
|
||||
#define V4L2_VP8_FRAME_HDR_FLAG_SHOW_FRAME 0x02
|
||||
#define V4L2_VP8_FRAME_HDR_FLAG_MB_NO_SKIP_COEFF 0x04
|
||||
struct v4l2_ctrl_vp8_frame_hdr {
|
||||
/* 0: keyframe, 1: not a keyframe */
|
||||
__u8 key_frame;
|
||||
__u8 version;
|
||||
|
||||
/* Populated also if not a key frame */
|
||||
__u16 width;
|
||||
__u8 horizontal_scale;
|
||||
__u16 height;
|
||||
__u8 vertical_scale;
|
||||
|
||||
struct v4l2_vp8_sgmnt_hdr sgmnt_hdr;
|
||||
struct v4l2_vp8_loopfilter_hdr lf_hdr;
|
||||
struct v4l2_vp8_quantization_hdr quant_hdr;
|
||||
struct v4l2_vp8_entropy_hdr entropy_hdr;
|
||||
|
||||
__u8 sign_bias_golden;
|
||||
__u8 sign_bias_alternate;
|
||||
|
||||
__u8 prob_skip_false;
|
||||
__u8 prob_intra;
|
||||
__u8 prob_last;
|
||||
__u8 prob_gf;
|
||||
|
||||
__u32 first_part_size;
|
||||
__u32 first_part_offset;
|
||||
/*
|
||||
* Offset in bits of MB data in first partition,
|
||||
* i.e. bit offset starting from first_part_offset.
|
||||
*/
|
||||
__u32 macroblock_bit_offset;
|
||||
|
||||
__u8 num_dct_parts;
|
||||
__u32 dct_part_sizes[8];
|
||||
|
||||
__u8 bool_dec_range;
|
||||
__u8 bool_dec_value;
|
||||
__u8 bool_dec_count;
|
||||
|
||||
/* v4l2_buffer indices of reference frames */
|
||||
__u32 last_frame;
|
||||
__u32 golden_frame;
|
||||
__u32 alt_frame;
|
||||
|
||||
__u8 flags;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -594,6 +594,7 @@ struct v4l2_pix_format {
|
|||
#define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */
|
||||
#define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */
|
||||
#define V4L2_PIX_FMT_VP8 v4l2_fourcc('V', 'P', '8', '0') /* VP8 */
|
||||
#define V4L2_PIX_FMT_VP8_FRAME v4l2_fourcc('V', 'P', '8', 'F') /* VP8 parsed frames */
|
||||
|
||||
/* Vendor-specific formats */
|
||||
#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
|
||||
|
|
@ -1478,6 +1479,7 @@ struct v4l2_ext_control {
|
|||
struct v4l2_ctrl_h264_scaling_matrix __user *p_h264_scal_mtrx;
|
||||
struct v4l2_ctrl_h264_slice_param __user *p_h264_slice_param;
|
||||
struct v4l2_ctrl_h264_decode_param __user *p_h264_decode_param;
|
||||
struct v4l2_ctrl_vp8_frame_hdr __user *p_vp8_frame_hdr;
|
||||
void __user *ptr;
|
||||
};
|
||||
} __attribute__ ((packed));
|
||||
|
|
@ -1527,6 +1529,7 @@ enum v4l2_ctrl_type {
|
|||
V4L2_CTRL_TYPE_H264_SCALING_MATRIX = 0x0105,
|
||||
V4L2_CTRL_TYPE_H264_SLICE_PARAM = 0x0106,
|
||||
V4L2_CTRL_TYPE_H264_DECODE_PARAM = 0x0107,
|
||||
V4L2_CTRL_TYPE_VP8_FRAME_HDR = 0x108,
|
||||
|
||||
V4L2_CTRL_TYPE_PRIVATE = 0xffff,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user