[FFmpeg-devel] [PATCH] Make VP3/Theora Decoder Much Faster

Jason Garrett-Glaser darkshikari
Wed Dec 2 18:54:09 CET 2009


On Wed, Dec 2, 2009 at 3:58 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Wed, Dec 02, 2009 at 12:41:25AM -0800, Jason Garrett-Glaser wrote:
>> Another optimization patch attached. ?Should be pretty obvious what it does.
> [...]
>> @@ -1366,7 +1366,7 @@
>>
>> ? ? ? ? ? ? ? ? ? ? ?/* check for outranging on the [ul u l] and
>> ? ? ? ? ? ? ? ? ? ? ? * [ul u ur l] predictors */
>> - ? ? ? ? ? ? ? ? ? ?if ((transform == 13) || (transform == 15)) {
>> + ? ? ? ? ? ? ? ? ? ?if ((transform == 15) || (transform == 13)) {
>> ? ? ? ? ? ? ? ? ? ? ? ? ?if (FFABS(predicted_dc - vu) > 128)
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?predicted_dc = vu;
>> ? ? ? ? ? ? ? ? ? ? ? ? ?else if (FFABS(predicted_dc - vl) > 128)
>
> is that faster?
>
> besides it could be simplified to
> (transform&~2) == 13

Here's the counts of "transform" for a test video of mine:

0
1259199
1
1535107
2
381091
3
524611
4
389036
5
262751
6
1650852
7
815610
8
258487
9
642334
10
119895
11
429238
12
259657
13
2210759
14
824384
15
29234918

As you can see, 15 is about 10 times more common than 13 (and
everything else for that matter), so I'm not sure that your
optimization makes sense.

Dark Shikari



More information about the ffmpeg-devel mailing list