[FFmpeg-devel] [PATCH 1/5] Shrink the size of vp56_mv

Måns Rullgård mans
Tue Jun 22 17:12:37 CEST 2010


"Ronald S. Bultje" <rsbultje at gmail.com> writes:

> Hi,
>
> 2010/6/22 M?ns Rullg?rd <mans at mansr.com>:
>> "Ronald S. Bultje" <rsbultje at gmail.com> writes:
>>> On Tue, Jun 15, 2010 at 2:52 PM, Reimar D?ffinger
>>> <Reimar.Doeffinger at gmx.de> wrote:
>>>> On Tue, Jun 15, 2010 at 04:58:14PM +0200, Aurelien Jacobs wrote:
>>>>> On Tue, Jun 15, 2010 at 09:02:14AM -0400, David Conrad wrote:
>>>>> > ---
>>>>> > ?libavcodec/vp56.h | ? ?4 ++--
>>>>> > ?1 files changed, 2 insertions(+), 2 deletions(-)
>>>>> >
>>>>> > diff --git a/libavcodec/vp56.h b/libavcodec/vp56.h
>>>>> > index 89eba05..3d98b9e 100644
>>>>> > --- a/libavcodec/vp56.h
>>>>> > +++ b/libavcodec/vp56.h
>>>>> > @@ -60,8 +60,8 @@ typedef struct {
>>>>> > ?} VP56RefDc;
>>>>> >
>>>>> > ?struct vp56_mv {
>>>>> > - ? ?int x;
>>>>> > - ? ?int y;
>>>>> > + ? ?int16_t x;
>>>>> > + ? ?int16_t y;
>>>>> > ?};
>>>>>
>>>>> Looks OK. Apply if you're sure that it can't overflow.
>>>>
>>>> Hm, might make sense to benchmark a bit, it might be slower e.g.
>>>> if it means a lot of sign extension is added to the code...
>>>
>>> Did someone benchmark this? I mean, I'm quite sure any difference on
>>> general decoding would be unnoticeable so I might need some pointers
>>> on what exactly to benchmark, to prevent me wasting my time.
>>
>> A simple test is to compare the size of .text on vp[56]+.o before and
>> after. ?More instructions would make it bigger.
>
> before:
>
> bash-3.2$ size libavcodec/vp{5,6,56}.o
> __TEXT	__DATA	__OBJC	others	dec	hex
> 24867	68	0	57091	82026	1406a	libavcodec/vp5.o
> 26244	260	0	68988	95492	17504	libavcodec/vp6.o
> 21629	0	0	48475	70104	111d8	libavcodec/vp56.o
>
> after:
>
> bash-3.2$ size libavcodec/vp{5,6,56}.o
> __TEXT	__DATA	__OBJC	others	dec	hex
> 24870	68	0	57069	82007	14057	libavcodec/vp5.o
> 26276	260	0	68811	95347	17473	libavcodec/vp6.o
> 21247	0	0	47836	69083	10ddb	libavcodec/vp56.o
>
> So vp56.o gets smaller, vp5.o and vp6.o slightly bigger. No idea what
> that means.

Disassemble and diff...

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list