[FFmpeg-devel] [PATCH] Don't initialize normal horizontal filter if MMX2 filter is used.

Ramiro Polla ramiro.polla
Fri Jan 15 01:52:14 CET 2010


On Thu, Jan 14, 2010 at 10:40 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Thu, Jan 14, 2010 at 04:04:28AM -0200, Ramiro Polla wrote:
>> $subj
>
>> ?swscale.c | ? 35 ++++++++++++++++++-----------------
>> ?1 file changed, 18 insertions(+), 17 deletions(-)
>> 20886640eeb074ef9e8b28dbfd5cf2c4195cc1de ?0002-Don-t-initialize-normal-horizontal-filter-if-MMX2-fi.patch
>> From 5d3fbc70561493036991270710bb5d2dc46f98f1 Mon Sep 17 00:00:00 2001
>> From: Ramiro Polla <ramiro.polla at gmail.com>
>> Date: Wed, 13 Jan 2010 17:51:36 -0200
>> Subject: [PATCH] Don't initialize normal horizontal filter if MMX2 filter is used.
>
> can the MMX2 code handle any pixel count (like 1? 3? 255? 257 ?)
> if not the C code and the tables is needed

Hmm, isn't that already checked for before these tables are initialized?

    if (flags & SWS_CPU_CAPS_MMX2) {
        c->canMMX2BeUsed= (dstW >=srcW && (dstW&31)==0 && (srcW&15)==0) ? 1 : 0;
        if (!c->canMMX2BeUsed && dstW >=srcW && (srcW&15)==0 &&
(flags&SWS_FAST_BILINEAR)) {
            if (flags&SWS_PRINT_INFO)
                av_log(c, AV_LOG_INFO, "output width is not a multiple
of 32 -> no MMX2 scaler\n");
        }
        if (usesHFilter) c->canMMX2BeUsed=0;
    }
    else
        c->canMMX2BeUsed=0;

and being canMMX2BeUsed set, the MMX2 scaler path will always be taken.



More information about the ffmpeg-devel mailing list