On Mon, Sep 9, 2013 at 3:37 PM, Vittorio Giovara <[email protected]
> wrote:
> ---
> I performed some more benchmarking and the results at higher bitrates show
> that the current implementation is better (by a tiny amount anyway). So I
> rebased and reimplemented my change just as code simplification, without
> modifying the inline attribute of the internal function.
>
> Cheers,
> Vittorio
>
> libavcodec/mpeg12enc.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
> index 2010d2a..a616f08 100644
> --- a/libavcodec/mpeg12enc.c
> +++ b/libavcodec/mpeg12enc.c
> @@ -602,13 +602,13 @@ next_coef:
>
> static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s,
> int16_t
> block[6][64],
> - int motion_x, int
> motion_y,
> - int mb_block_count)
> + int motion_x, int
> motion_y)
> {
> int i, cbp;
> const int mb_x = s->mb_x;
> const int mb_y = s->mb_y;
> const int first_mb = mb_x == s->resync_mb_x && mb_y == s->resync_mb_y;
> + const int mb_block_count = s->chroma_format == CHROMA_420 ? 6 : 8;
>
> /* compute cbp */
> cbp = 0;
> @@ -881,10 +881,7 @@ static av_always_inline void
> mpeg1_encode_mb_internal(MpegEncContext *s,
> void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[6][64],
> int motion_x, int motion_y)
> {
> - if (s->chroma_format == CHROMA_420)
> - mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 6);
> - else
> - mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 8);
> + return mpeg1_encode_mb_internal(s, block, motion_x, motion_y);
> }
>
> av_cold void ff_mpeg1_encode_init(MpegEncContext *s)
> --
> 1.7.9.5
>
The whole point of this function was to make mb_block_count a constant when
inlined, which your patch destroys.
I see no real point in this "improvement".
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel