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

media: v4l2-ctrls: Add intra-refresh period control

Add a control to set intra-refresh period.

Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Stanimir Varbanov and committed by
Mauro Carvalho Chehab
9d5adeec ea9f9119

+19 -1
+16 -1
Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
··· 1175 1175 macroblocks refreshed every frame. Each frame a successive set of 1176 1176 macroblocks is refreshed until the cycle completes and starts from 1177 1177 the top of the frame. Setting this control to zero means that 1178 - macroblocks will not be refreshed. 1178 + macroblocks will not be refreshed. Note that this control will not 1179 + take effect when ``V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD`` control 1180 + is set to non zero value. 1179 1181 Applicable to H264, H263 and MPEG4 encoder. 1182 + 1183 + ``V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD (integer)`` 1184 + Intra macroblock refresh period. This sets the period to refresh 1185 + the whole frame. In other words, this defines the number of frames 1186 + for which the whole frame will be intra-refreshed. An example: 1187 + setting period to 1 means that the whole frame will be refreshed, 1188 + setting period to 2 means that the half of macroblocks will be 1189 + intra-refreshed on frameX and the other half of macroblocks 1190 + will be refreshed in frameX + 1 and so on. Setting the period to 1191 + zero means no period is specified. 1192 + Note that if the client sets this control to non zero value the 1193 + ``V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB`` control shall be 1194 + ignored. Applicable to H264 and HEVC encoders. 1180 1195 1181 1196 ``V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (boolean)`` 1182 1197 Frame level rate control enable. If this control is disabled then
+2
drivers/media/v4l2-core/v4l2-ctrls-defs.c
··· 833 833 case V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE: return "Decoder Slice Interface"; 834 834 case V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER: return "MPEG4 Loop Filter Enable"; 835 835 case V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB: return "Number of Intra Refresh MBs"; 836 + case V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD: return "Intra Refresh Period"; 836 837 case V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE: return "Frame Level Rate Control Enable"; 837 838 case V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE: return "H264 MB Level Rate Control"; 838 839 case V4L2_CID_MPEG_VIDEO_HEADER_MODE: return "Sequence Header Mode"; ··· 1259 1258 case V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE: 1260 1259 case V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE: 1261 1260 case V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY: 1261 + case V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD: 1262 1262 *type = V4L2_CTRL_TYPE_INTEGER; 1263 1263 break; 1264 1264 case V4L2_CID_MPEG_VIDEO_LTR_COUNT:
+1
include/uapi/linux/v4l2-controls.h
··· 435 435 #define V4L2_CID_MPEG_VIDEO_FRAME_LTR_INDEX (V4L2_CID_CODEC_BASE+233) 436 436 #define V4L2_CID_MPEG_VIDEO_USE_LTR_FRAMES (V4L2_CID_CODEC_BASE+234) 437 437 #define V4L2_CID_MPEG_VIDEO_DEC_CONCEAL_COLOR (V4L2_CID_CODEC_BASE+235) 438 + #define V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD (V4L2_CID_CODEC_BASE+236) 438 439 439 440 /* CIDs for the MPEG-2 Part 2 (H.262) codec */ 440 441 #define V4L2_CID_MPEG_VIDEO_MPEG2_LEVEL (V4L2_CID_CODEC_BASE+270)