[FFmpeg-devel] [HACK] 50% faster H.264 decoding

Ronald S. Bultje rsbultje
Tue Aug 17 17:01:03 CEST 2010


Hi,

On Mon, Aug 16, 2010 at 6:40 PM, Jason Garrett-Glaser
<darkshikari at gmail.com> wrote:
> On Mon, Aug 16, 2010 at 3:35 PM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
>> Hi,
>>
>> On Wed, Aug 11, 2010 at 5:32 PM, Jason Garrett-Glaser
>> <darkshikari at gmail.com> wrote:
>>> 13. Use MPEG-2 MC for chroma MC, since we know that MVs are
>>> fullpel-only. ?Simplify edge emulation stuff accordingly too.
>>
>> Does h264 chroma subpel actually use a memcpy shortcut if it's
>> fullpel? I don't remember exactly, but I don't think it has such a
>> shortcut for chroma, only for luma.
>
> It doesn't. ?It should at least have a shortcut for the 0,0 motion
> vector because its very high probability (relative to other fullpel
> motion vectors that result in no chroma interpolation). ?For other
> cases, it might or might not be worthwhile to add a branch in the asm
> to the 1D-only case.

Attached sets up framework for that. The [0] functions can be copied
straight from VP8 (they are pixel_copy functions, with very fast
aligned implementations for all relevant archs) and others, and should
make VC-1, RV3/4, h264, H264/MPEG etc. significantly faster for the
MVxy==0 case. The [1]/[2] functions are probably going to be faster as
well but that would need some testing to see how big the effect is.
[3] is the function as-is now, which should obviously stay the way it
is.

Michael, OK to apply this? It's mostly just changing all kind of files
to fill arrays instead of a single function pointer, and to pick the
correct one from the array[4] instead of the single function pointer.
It doesn't actually change any speed-relevant code so should have no
effect. Also, changes to sh4/ppc/arm dirs are untested.

After this we can optimize the MV=0 and later MVx=0/MVy=0 cases, which
should then perform significantly better, as per above.

Ronald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: h264-chroma-mvzero-shortcut.patch
Type: application/octet-stream
Size: 38797 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100817/21613609/attachment.obj>



More information about the ffmpeg-devel mailing list