[FFmpeg-devel] [PATCH 1/5] avcodec/proresenc_anatoliy: use a compatible bitstream version

Stefano Sabatini stefasab at gmail.com
Mon Jan 8 21:54:31 EET 2024


On date Sunday 2024-01-07 19:16:43 +0100, Clément Bœsch wrote:
> Quoting SMPTE RDD 36:2015:
>   A decoder shall abort if it encounters a bitstream with an unsupported
>   bitstream_version value. If 0, the value of the chroma_format syntax
>   element shall be 2 (4:2:2 sampling) and the value of the
>   alpha_channel_type element shall be 0 (no encoded alpha); if 1, any
>   permissible value may be used for those syntax elements.
> 
> So if we're not in 4:2:2 or if there is alpha, we are not allowed to use
> version 0.
> ---
>  libavcodec/proresenc_anatoliy.c             | 2 +-
>  tests/ref/vsynth/vsynth1-prores_444         | 2 +-
>  tests/ref/vsynth/vsynth1-prores_444_int     | 2 +-
>  tests/ref/vsynth/vsynth2-prores_444         | 2 +-
>  tests/ref/vsynth/vsynth2-prores_444_int     | 2 +-
>  tests/ref/vsynth/vsynth3-prores_444         | 2 +-
>  tests/ref/vsynth/vsynth3-prores_444_int     | 2 +-
>  tests/ref/vsynth/vsynth_lena-prores_444     | 2 +-
>  tests/ref/vsynth/vsynth_lena-prores_444_int | 2 +-
>  9 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
> index 9b9ffa03be..2223721aa0 100644
> --- a/libavcodec/proresenc_anatoliy.c
> +++ b/libavcodec/proresenc_anatoliy.c
> @@ -765,7 +765,7 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
>      bytestream_put_buffer(&buf, "icpf", 4);
>  
>      bytestream_put_be16(&buf, header_size);
> -    bytestream_put_be16(&buf, 0); /* version */
> +    bytestream_put_be16(&buf, avctx->pix_fmt != AV_PIX_FMT_YUV422P10 || ctx->need_alpha ? 1 : 0); /* version */

LGTM, thanks.


More information about the ffmpeg-devel mailing list