[FFmpeg-devel] [PATCH 02/18] h264: Add stream constraint values to the common header

Michael Niedermayer michael at niedermayer.cc
Mon Aug 21 04:09:51 EEST 2017


On Sun, Aug 20, 2017 at 11:41:30PM +0100, Mark Thompson wrote:
> With comments describing the derivation of each value.
> 
> (cherry picked from commit aaf441465080b9bc57f5ca8dea656f9b2c5dc821)
> ---
>  libavcodec/h264.h | 45 +++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 45 insertions(+)
> 
> diff --git a/libavcodec/h264.h b/libavcodec/h264.h
> index 86df5eb9b3..650580bf3a 100644
> --- a/libavcodec/h264.h
> +++ b/libavcodec/h264.h
> @@ -44,4 +44,49 @@ enum {
>      H264_NAL_AUXILIARY_SLICE = 19,
>  };
>  
> +
> +enum {

why is this a enum ?


> +    // 7.4.2.1.1: seq_parameter_set_id is in [0, 31].
> +    H264_MAX_SPS_COUNT = 32,

Could be doxygen comment compatible


[...]

> +    // A.3: in table A-1 the highest level allows a MaxFS of 139264.
> +    H264_MAX_MB_PIC_SIZE = 139264,
> +    // A.3.1, A.3.2: PicWidthInMbs and PicHeightInMbs are constrained
> +    // to be not greater than sqrt(MaxFS * 8).  Hence height/width are
> +    // bounded above by sqrt(139264 * 8) = 1055.5 macroblocks.
> +    H264_MAX_MB_WIDTH    = 1055,
> +    H264_MAX_MB_HEIGHT   = 1055,
> +    H264_MAX_WIDTH       = H264_MAX_MB_WIDTH  * 16,
> +    H264_MAX_HEIGHT      = H264_MAX_MB_HEIGHT * 16,

There should be no problem with files outside these limits. They would
be valid H.264 files, just not within the level and profile constraints
of the currently defined profiles and levels.
or do i miss something ?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Democracy is the form of government in which you can choose your dictator
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170821/b476abfb/attachment.sig>


More information about the ffmpeg-devel mailing list