[FFmpeg-devel] [PATCH v2 3/6] ffv1enc: split off encoder initialization into a separate function
Michael Niedermayer
michael at niedermayer.cc
Thu Nov 14 01:46:47 EET 2024
On Mon, Nov 11, 2024 at 04:40:15AM +0100, Lynne via ffmpeg-devel wrote:
> ---
> libavcodec/ffv1enc.c | 354 +++++++++++++++++++++++--------------------
> libavcodec/ffv1enc.h | 30 ++++
> 2 files changed, 217 insertions(+), 167 deletions(-)
> create mode 100644 libavcodec/ffv1enc.h
>
> diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
> index 7a6c718b41..ca2c9f32e2 100644
> --- a/libavcodec/ffv1enc.c
> +++ b/libavcodec/ffv1enc.c
[...]
> @@ -873,7 +907,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
> continue;
> if (maxw * maxh * (int64_t)(s->bits_per_raw_sample+1) * plane_count > 8<<24)
> continue;
> - if (s->version < 4)
> + if (avctx->level < 4)
> if ( ff_need_new_slices(avctx->width , s->num_h_slices, s->chroma_h_shift)
> ||ff_need_new_slices(avctx->height, s->num_v_slices, s->chroma_v_shift))
> continue;
avctx->level is read only from the point of view of the encoder
while s->level can (and is sometimes) changed by the encoder
So in cases where version is adjusted across 4, level would be wrong,
it may be that this doesnt occur ATM but its still not correct
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20241114/546580fa/attachment.sig>
More information about the ffmpeg-devel
mailing list