[FFmpeg-devel] [PATCH 4/4] proresenc_kostya: properly account for alpha

Michael Niedermayer michaelni at gmx.at
Tue Aug 12 01:56:51 CEST 2014


On Mon, Aug 11, 2014 at 10:06:10PM +0000, Christophe Gisquet wrote:
> The packet buffer allocation considered as dct-coded, while it is
> actually run-coded and thus requires a larger buffer.
> ---
>  libavcodec/proresenc_kostya.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c
> index 2cd33ce..443ea76 100644
> --- a/libavcodec/proresenc_kostya.c
> +++ b/libavcodec/proresenc_kostya.c
> @@ -1232,16 +1232,23 @@ static av_cold int encode_init(AVCodecContext *avctx)
>          ctx->bits_per_mb = ls * 8;
>          if (ctx->chroma_factor == CFACTOR_Y444)
>              ctx->bits_per_mb += ls * 4;
> -        if (ctx->num_planes == 4)
> -            ctx->bits_per_mb += ls * 4;
>      }
>  
>      ctx->frame_size_upper_bound = ctx->pictures_per_frame *
>                                    ctx->slices_per_picture *

> -                                  (2 + 2 * ctx->num_planes +
> +                                  (2 + 2 * FFMIN(3, ctx->num_planes) +

slice_hdr_size is  2 + 2 * (ctx->num_planes - 1);

is this difference intended ?

also ctx->num_planes is currently either 3 or 4 which would make the
FFMIN a constant


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

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140812/dc7840e1/attachment.asc>


More information about the ffmpeg-devel mailing list