Statistics
| Branch: | Revision:

ffmpeg / libavcodec / vp3.c @ 4a5a1689

History | View | Annotate | Download (81.5 KB)

# Date Author Comment
4a5a1689 02/11/2011 01:54 AM Alexander Strange

vp3: Frame-based multithreading support

Decode times for big_buck_bunny_720p_stereo:

1 thread:
real 1m14.227s
user 1m13.104s
sys 0m1.108s

2 threads: (33% faster)
real 0m49.329s
user 1m33.735s
sys 0m1.834s

3 threads: (44% faster)
real 0m41.593s...

3c90abf4 02/06/2011 07:31 PM Alexander Strange

vp3: Move table allocation code into a new function

Signed-off-by: Ronald S. Bultje <>
(cherry picked from commit edbb0c07081e78a4c7b6d999d641183bf30f1a2e)

dc4a1883 02/06/2011 07:31 PM Alexander Strange

vp3: Factor out expression

Signed-off-by: Ronald S. Bultje <>
(cherry picked from commit e8dcd730583a0aa69c33a17fc27d65fa55f5effe)

d23e3e5f 01/30/2011 02:41 AM Ronald S. Bultje

Move ff_emulated_edge_mc() into DSPContext.
(cherry picked from commit 2e279598793133ee9c57fd0026d672f076fde4bf)

e7e2df27 01/28/2011 02:15 AM Diego Elio Pettenò

Add ff_ prefix to data symbols of encoders, decoders, hwaccel, parsers, bsf.

None of these symbols should be accessed directly, so declare them as
hidden.

Signed-off-by: Mans Rullgard <>
(cherry picked from commit d36beb3f6902b1217beda576aa18abf7eb72b03c)

6ee99a7e 01/17/2011 08:36 AM Alexander Strange

VP3: remove an unnecessary static variable

Originally committed as revision 26398 to svn://svn.ffmpeg.org/ffmpeg/trunk

9d777508 10/26/2010 07:37 AM Jason Garrett-Glaser

Remove dead code in theora_decode_tables
Reading 7 bits as an unsigned int can't result in a value exceeding 127.
Accordingly, remove error message (as it'll never be reached).

Originally committed as revision 25575 to svn://svn.ffmpeg.org/ffmpeg/trunk

10f69158 10/26/2010 07:30 AM Jason Garrett-Glaser

Reindent after r25573

Originally committed as revision 25574 to svn://svn.ffmpeg.org/ffmpeg/trunk

1a48a570 10/26/2010 07:29 AM Jason Garrett-Glaser

Fix Theora decoding bug if loopfilter is completely disabled
Bug caused by the fact that get_bits(gb, 0) is undefined.
Doesn't affect any streams generated by the official Theora encoder, but such
streams are nevertheless valid.

Fixes decoding of CELT-933dd833-nmr-bandt.ogv....

83f72f13 09/08/2010 05:51 AM Reimar Döffinger

Only draw the actually visible area in vp3_draw_horiz_band.
Fixes a black line in non-swapped, non-mod-16-height Theora videos
when vp3_draw_horiz_band is used.

Originally committed as revision 25073 to svn://svn.ffmpeg.org/ffmpeg/trunk

e16f217c 09/07/2010 07:15 PM Stefano Sabatini

Use new imgutils.h API names, fix deprecation warnings.

Originally committed as revision 25058 to svn://svn.ffmpeg.org/ffmpeg/trunk

3d487db1 09/06/2010 07:26 PM Reimar Döffinger

Fix slice height for y position calculation for vp3_draw_horiz_band
when the video uses 4:2:2 instead of 4:2:0 coding.

Originally committed as revision 25052 to svn://svn.ffmpeg.org/ffmpeg/trunk

3b9ee20f 09/06/2010 07:21 PM Reimar Döffinger

Fix vp3_draw_horiz_band to not produce completely chaotical values
that result in overdrawing areas again and again if s->flipped_image
is false.

Originally committed as revision 25051 to svn://svn.ffmpeg.org/ffmpeg/trunk

6974952d 09/06/2010 05:53 PM Reimar Döffinger

VP3/Theora: validate aspect and reduce it before exporting it
via the context.

Originally committed as revision 25050 to svn://svn.ffmpeg.org/ffmpeg/trunk

6ce9b431 08/06/2010 09:37 AM Stefano Sabatini

Remove use of the deprecated function avcodec_check_dimensions(), use
av_check_image_size() instead.

Originally committed as revision 24711 to svn://svn.ffmpeg.org/ffmpeg/trunk

49bd8e4b 06/30/2010 03:38 PM Måns Rullgård

Fix grammar errors in documentation

Originally committed as revision 23904 to svn://svn.ffmpeg.org/ffmpeg/trunk

8764389d 06/08/2010 07:25 PM Reimar Döffinger

Fix vp3_draw_horiz_band to calculate chroma offsets correctly
for 4:2:2 and 4:4:4 formats.

Originally committed as revision 23537 to svn://svn.ffmpeg.org/ffmpeg/trunk

a4501a45 05/27/2010 04:39 AM David Conrad

vp3: Skip the loop filter when strength is 0 or when requested

Originally committed as revision 23346 to svn://svn.ffmpeg.org/ffmpeg/trunk

cc46005f 05/25/2010 03:19 AM David Conrad

theora: Don't read an excess bit for maximum length long bit runs if the run
exactly ends the remaining blocks.

Originally committed as revision 23304 to svn://svn.ffmpeg.org/ffmpeg/trunk

8e6daa4a 04/21/2010 01:19 PM David Conrad

theora: coeff huffman codes are allowed to be up to 32 bits long (for 32 tokens)

Originally committed as revision 22931 to svn://svn.ffmpeg.org/ffmpeg/trunk

ba87f080 04/20/2010 02:45 PM Diego Biurrun

Remove explicit filename from Doxygen @file commands.

Passing an explicit filename to this command is only necessary if the
documentation in the @file block refers to a file different from the
one the block resides in.

Originally committed as revision 22921 to svn://svn.ffmpeg.org/ffmpeg/trunk

33e62383 04/17/2010 10:37 AM David Conrad

vp3: Use avctx pointer directly

Originally committed as revision 22899 to svn://svn.ffmpeg.org/ffmpeg/trunk

8099d6c9 04/17/2010 02:04 AM David Conrad

vp3: Read fps and aspect ratio in the decoder

Originally committed as revision 22898 to svn://svn.ffmpeg.org/ffmpeg/trunk

ddc7e438 04/17/2010 02:04 AM David Conrad

vp3: Don't crop if there's a left/top offset, it's wrong

Fixes issue1834

Originally committed as revision 22897 to svn://svn.ffmpeg.org/ffmpeg/trunk

eb6a6cd7 04/17/2010 02:04 AM David Conrad

vp3: DC-only IDCT

2-4% faster overall decode

Originally committed as revision 22896 to svn://svn.ffmpeg.org/ffmpeg/trunk

60867312 04/16/2010 12:21 PM David Conrad

vp3: More buffer length checks

.5% slower to fix some crashes on invalid streams

Originally committed as revision 22893 to svn://svn.ffmpeg.org/ffmpeg/trunk

d7097c2d 04/16/2010 12:21 PM David Conrad

vp3: Remove internal debug statement

Originally committed as revision 22892 to svn://svn.ffmpeg.org/ffmpeg/trunk

72415b2a 03/30/2010 11:30 PM Stefano Sabatini

Define AVMediaType enum, and use it instead of enum CodecType, which
is deprecated and will be dropped at the next major bump.

Originally committed as revision 22735 to svn://svn.ffmpeg.org/ffmpeg/trunk

14268254 03/13/2010 10:25 AM David Conrad

vp3: Split out motion vectors to their own array

1.5% faster overall decode on my penryn

Originally committed as revision 22504 to svn://svn.ffmpeg.org/ffmpeg/trunk

1e76a1da 03/13/2010 05:59 AM David Conrad

theora: Add support for 4:2:2 and 4:4:4 subsampling

Originally committed as revision 22500 to svn://svn.ffmpeg.org/ffmpeg/trunk

1a856042 03/13/2010 05:59 AM David Conrad

vp3: remove unneeded error, this is internal and doesn't happen

Originally committed as revision 22499 to svn://svn.ffmpeg.org/ffmpeg/trunk

57783884 03/13/2010 05:56 AM David Conrad

vp3: Make fragment_width _height by plane

Originally committed as revision 22498 to svn://svn.ffmpeg.org/ffmpeg/trunk

1c183aa4 03/13/2010 05:56 AM David Conrad

vp3: we only need a temp MV array of size 4

Originally committed as revision 22497 to svn://svn.ffmpeg.org/ffmpeg/trunk

703acd54 03/13/2010 05:56 AM David Conrad

vp3: Use memset to clear the fragment array

Originally committed as revision 22496 to svn://svn.ffmpeg.org/ffmpeg/trunk

cd9c03f5 03/13/2010 05:56 AM David Conrad

vp3: Init MVs to 0

Originally committed as revision 22495 to svn://svn.ffmpeg.org/ffmpeg/trunk

a16389c1 03/13/2010 05:56 AM David Conrad

vp3: Simplify init_block_mapping

Originally committed as revision 22494 to svn://svn.ffmpeg.org/ffmpeg/trunk

f50dafa8 03/10/2010 12:59 AM David Conrad

vp3: avoid buffer overread in coeff decode

I couldn't measure it to be slower for normal interframe videos.
For the worst case, high-bitrate intra-only videos, it can be 0.7% slower.

Originally committed as revision 22416 to svn://svn.ffmpeg.org/ffmpeg/trunk

d63a7187 03/09/2010 06:52 AM David Conrad

vp3: correctly clip vp3_draw_horiz_band call

Originally committed as revision 22377 to svn://svn.ffmpeg.org/ffmpeg/trunk

ff65969f 03/09/2010 12:29 AM David Conrad

vp3: Set pict_type

Originally committed as revision 22361 to svn://svn.ffmpeg.org/ffmpeg/trunk

7a4e8b59 03/09/2010 12:29 AM David Conrad

vp3: Allocate a dummy reference frame if we have no keyframe

Originally committed as revision 22360 to svn://svn.ffmpeg.org/ffmpeg/trunk

0c9afacb 03/09/2010 12:29 AM David Conrad

vp3: use FF_BUFFER_TYPE_COPY

Originally committed as revision 22359 to svn://svn.ffmpeg.org/ffmpeg/trunk

e72d2d12 03/09/2010 12:29 AM David Conrad

vp3: Don't leak buffers on errors

Originally committed as revision 22358 to svn://svn.ffmpeg.org/ffmpeg/trunk

739b5090 03/09/2010 12:29 AM David Conrad

vp3: Simplify buffer management

Originally committed as revision 22357 to svn://svn.ffmpeg.org/ffmpeg/trunk

01f9640b 03/09/2010 12:29 AM David Conrad

vp3: be less spammy on broken files

Originally committed as revision 22356 to svn://svn.ffmpeg.org/ffmpeg/trunk

84dc2d8a 03/06/2010 02:24 PM Måns Rullgård

Remove DECLARE_ALIGNED_{8,16} macros

These macros are redundant. All uses are replaced with the generic
DECLARE_ALIGNED macro instead.

Originally committed as revision 22233 to svn://svn.ffmpeg.org/ffmpeg/trunk

e2720b6b 03/04/2010 10:01 AM David Conrad

Really fix 2.95

Originally committed as revision 22204 to svn://svn.ffmpeg.org/ffmpeg/trunk

0448ef77 03/04/2010 09:25 AM David Conrad

Maybe fix gcc 2.95

Originally committed as revision 22203 to svn://svn.ffmpeg.org/ffmpeg/trunk

c72625f2 03/03/2010 11:27 PM David Conrad

Delay translating DCT tokens into coefficients until immediately before IDCT

This is generally around 12% faster than the prior method of creating a
linked list for each block as tokens are read, but can be anywhere from
8% to 28% faster depending on file and CPU....

7a095ea6 03/03/2010 11:27 PM David Conrad

Do MC and IDCT in coding (hilbert) order

This increases the slice size to 64 pixels, due to having to decode an
entire chroma superblock row per slice.

This can be up to 6% slower depending on clip and CPU, but is necessary
for future optimizations that gain significantly more than was lost....

35c28d23 03/03/2010 11:27 PM David Conrad

Explictly separate decoding whether fragments are coded by plane

Originally committed as revision 22188 to svn://svn.ffmpeg.org/ffmpeg/trunk

770128c4 02/28/2010 03:02 AM Carl Eugen Hoyos

Remove declaration of unused variables.

Originally committed as revision 22102 to svn://svn.ffmpeg.org/ffmpeg/trunk

6cb35b45 02/21/2010 12:11 AM David Conrad

Simplify determing whether fragments are coded

No measurable speed difference

Originally committed as revision 21931 to svn://svn.ffmpeg.org/ffmpeg/trunk

a8926476 02/21/2010 12:10 AM David Conrad

Handle Theora's continued runs in superblock coding.

This doesn't really matter yet since 4:2:0 1080p has only 3060 superblocks,
but larger resolutions or 4:4:4 1080p could hit this case.

Originally committed as revision 21930 to svn://svn.ffmpeg.org/ffmpeg/trunk

855c720c 02/21/2010 12:10 AM David Conrad

Decode fully coded superblocks in the same manner as partial superblocks and qpi

No speed difference, but it will simplify the special 4129 case.

Originally committed as revision 21929 to svn://svn.ffmpeg.org/ffmpeg/trunk

ecb51b25 02/21/2010 12:10 AM David Conrad

Make the special 4129 case for long-run bit strings a #define and explain it

Originally committed as revision 21928 to svn://svn.ffmpeg.org/ffmpeg/trunk

33dbc1b7 02/21/2010 12:10 AM David Conrad

Use memset to set the runs partially coded superblocks

Much faster for long runs (e.g. nearly uncoded frames), slightly faster
for the general case.

Originally committed as revision 21927 to svn://svn.ffmpeg.org/ffmpeg/trunk

40d11227 02/17/2010 08:36 PM Måns Rullgård

Use LOCAL_ALIGNED macro for local arrays

Originally committed as revision 21866 to svn://svn.ffmpeg.org/ffmpeg/trunk

161e8cf4 02/13/2010 06:59 PM David Conrad

Move CODEC_FLAG_GRAY check to outer loop

Originally committed as revision 21805 to svn://svn.ffmpeg.org/ffmpeg/trunk

7c2e31d1 02/13/2010 06:59 PM David Conrad

Move branch based on custom mode outside the loop

Originally committed as revision 21804 to svn://svn.ffmpeg.org/ffmpeg/trunk

eb691ef2 02/13/2010 06:55 PM David Conrad

Directly check whether a fragment is coded for 4MV mode instead of iterating
through the entire coded fragment list.

Originally committed as revision 21803 to svn://svn.ffmpeg.org/ffmpeg/trunk

15675ce6 02/13/2010 06:55 PM David Conrad

Eliminate fragment -> macroblock mapping array

Originally committed as revision 21802 to svn://svn.ffmpeg.org/ffmpeg/trunk

ea676144 02/13/2010 06:55 PM David Conrad

Eliminate macroblock -> fragment mapping array

Originally committed as revision 21801 to svn://svn.ffmpeg.org/ffmpeg/trunk

19cd517d 02/13/2010 06:55 PM David Conrad

Eliminate superblock <-> macroblock mapping array

Originally committed as revision 21800 to svn://svn.ffmpeg.org/ffmpeg/trunk

735acf56 02/12/2010 10:01 PM David Conrad

Don't pre-calculate first_pixel

3.6% faster on Elephants_Dream_HD-q7-aq7.ogg on my penryn

Originally committed as revision 21781 to svn://svn.ffmpeg.org/ffmpeg/trunk

a8de3901 02/12/2010 10:01 PM David Conrad

Implement CODEC_CAP_DRAW_HORIZ_BAND for VP3 decoder

Originally committed as revision 21780 to svn://svn.ffmpeg.org/ffmpeg/trunk

621f9a40 02/12/2010 10:01 PM David Conrad

Cosmetics: reindent

Originally committed as revision 21779 to svn://svn.ffmpeg.org/ffmpeg/trunk

256c0662 02/12/2010 10:01 PM David Conrad

Do loop filter per-row rather than per-frame

3% faster on Elephants_Dream_HD-q7-aq7.ogg on my penryn

Originally committed as revision 21778 to svn://svn.ffmpeg.org/ffmpeg/trunk

fe313556 02/12/2010 10:01 PM David Conrad

Move apply_loop_filter above render_slice, it'll be used by the latter soon

Originally committed as revision 21777 to svn://svn.ffmpeg.org/ffmpeg/trunk

ea3c2d53 02/12/2010 10:01 PM David Conrad

Export Theora colorspace info if present

Originally committed as revision 21776 to svn://svn.ffmpeg.org/ffmpeg/trunk

337f5c6e 02/12/2010 10:01 PM David Conrad

Theora 3.4 doesn't exist; these fields were misunderstandings of the spec

Originally committed as revision 21775 to svn://svn.ffmpeg.org/ffmpeg/trunk

45c3c925 02/12/2010 10:00 PM David Conrad

Remove unused code that's moved elsewhere

Originally committed as revision 21774 to svn://svn.ffmpeg.org/ffmpeg/trunk

c6727809 01/22/2010 03:25 AM Måns Rullgård

Move array specifiers outside DECLARE_ALIGNED() invocations

Originally committed as revision 21377 to svn://svn.ffmpeg.org/ffmpeg/trunk

da8af938 12/19/2009 07:34 AM Mike Melanson

Cosmetic: indent after last change.

Originally committed as revision 20896 to svn://svn.ffmpeg.org/ffmpeg/trunk

e6e32bdc 12/19/2009 07:33 AM Mike Melanson

Optimize unpack_vectors() by not shuffling around redundant vectors.
Inspired by guidance from Dark Shikari. On a Core 2 Duo 2.0 GHz, this
change decodes the 10-minute Big Buck Bunny 1080p short about 2 seconds
faster.

Originally committed as revision 20895 to svn://svn.ffmpeg.org/ffmpeg/trunk

08f19605 12/06/2009 03:39 PM Carl Eugen Hoyos

Cosmetics: Fix indentation after r20751.

Originally committed as revision 20752 to svn://svn.ffmpeg.org/ffmpeg/trunk

bfb5a8ce 12/06/2009 03:38 PM Jason Garrett-Glaser

Simplified deblocking checks.

Patch by Dark Shikari

Originally committed as revision 20751 to svn://svn.ffmpeg.org/ffmpeg/trunk

50ba3fd7 12/06/2009 03:33 PM Jason Garrett-Glaser

Faster checks in reverse_dc_prediction.

Patch by Dark Shikari

Originally committed as revision 20750 to svn://svn.ffmpeg.org/ffmpeg/trunk

c11cb375 12/06/2009 03:31 PM Jason Garrett-Glaser

Check transform==15 first, since it's more common than 13.

Patch by Dark Shikari

Originally committed as revision 20749 to svn://svn.ffmpeg.org/ffmpeg/trunk

306a61b3 12/06/2009 03:30 PM Carl Eugen Hoyos

Revert r20747: It mixed functional and cosmetical changes.

Originally committed as revision 20748 to svn://svn.ffmpeg.org/ffmpeg/trunk

63c0b3d9 12/06/2009 12:48 PM Jason Garrett-Glaser

Various VP3 optimizations.
Faster checks in reverse_dc_prediction.
Simplified deblocking checks.
Check transform==15 first, since it's more common than 13.

Originally committed as revision 20747 to svn://svn.ffmpeg.org/ffmpeg/trunk

9d8bb031 12/02/2009 04:06 AM Mike Melanson

Small refactoring: Instead of 4 loops for decoding AC coefficients based
on their grouping, create one loop that indexes into a table of AC VLC
tables.

There is also a small optimization here: Do not call unpack_vlcs()
if there are no fragments in the list with outstanding coefficients....

098523eb 12/02/2009 02:30 AM Mike Melanson

Use a list to track which fragments coded in this frame still have
outstanding coefficients yet to be decoded from the bitstream. Once a
fragment reaches end-of-block, remove it from this new list. This change
makes the VP3/Theora entropy decode process dramatically faster due to...

0efbd068 09/24/2009 06:33 AM Mike Melanson

Make sure that all memory allocations succeed.
Based on 28_theora_malloc_checks.patch from the Google Chrome team.

Originally committed as revision 20008 to svn://svn.ffmpeg.org/ffmpeg/trunk

310afddf 09/23/2009 12:42 PM Google Chrome

Fix >= vs > check of coded_fragment_list_index.
22_fix_theora_frag_fencepost.patch by chrome

Originally committed as revision 19995 to svn://svn.ffmpeg.org/ffmpeg/trunk

fa6f2751 09/23/2009 12:27 PM Google Chrome

Fix init_get_bits() buffer size.
18_fix_theora_header_bit_len.patch by chrome

Originally committed as revision 19993 to svn://svn.ffmpeg.org/ffmpeg/trunk

428984b0 09/23/2009 05:38 AM Mike Melanson

Another micro-optimization for unpack_vlcs(): Eliminate a possible
branch and save around 45k-55k dezicycles per function run.

Originally committed as revision 19974 to svn://svn.ffmpeg.org/ffmpeg/trunk

138fe832 09/22/2009 03:58 PM Mike Melanson

Perform the DC prediction reversal immediately after decoding all of
the DC coefficients. This has a greater probability of leveraging the
coefficients while they are still cached.

When testing with the Big Buck Bunny 1080p video, I consistently saw
improvements of 500k-600k dezicycles per run (through...

ee3d7f58 09/21/2009 01:37 AM Mike Melanson

Modify unpack_vlcs() so that there are fewer dereferences through the
main (heavily iterated) loop.

Originally committed as revision 19934 to svn://svn.ffmpeg.org/ffmpeg/trunk

b8791583 09/06/2009 08:27 AM Reimar Döffinger

compatible_frame array can be static const, too.

Originally committed as revision 19779 to svn://svn.ffmpeg.org/ffmpeg/trunk

bb991087 09/05/2009 05:28 PM Reimar Döffinger

Make vp3 arrays static const where possible.

Originally committed as revision 19771 to svn://svn.ffmpeg.org/ffmpeg/trunk

3aab27b4 07/22/2009 11:37 PM Måns Rullgård

Remove useless #include <unistd.h> from many files

Originally committed as revision 19499 to svn://svn.ffmpeg.org/ffmpeg/trunk

c79c960a 07/06/2009 10:28 AM Reimar Döffinger

Remove useless ret variable added in last revision again.

Originally committed as revision 19357 to svn://svn.ffmpeg.org/ffmpeg/trunk

7cda8150 07/06/2009 09:35 AM Reimar Döffinger

100l, theora_decode_init must pass on errors from vp3_decode_init

Originally committed as revision 19356 to svn://svn.ffmpeg.org/ffmpeg/trunk

c4b7b8bf 07/06/2009 09:22 AM Reimar Döffinger

Make decode_init fail if the huffman tables are invalid and thus init_vlc fails.
Otherwise this will crash during decoding because the vlc tables are NULL.
Partially fixes ogv/smclock.ogv.1.101.ogv from issue 1240.

Originally committed as revision 19355 to svn://svn.ffmpeg.org/ffmpeg/trunk

e13cca4b 07/05/2009 06:27 PM Reimar Döffinger

Ensure that the filter limit values do not exceed the maximum allowed value of 127.

Originally committed as revision 19351 to svn://svn.ffmpeg.org/ffmpeg/trunk

7fa5f999 07/05/2009 06:25 PM Reimar Döffinger

Extend init_loop_filter to work for filter limit values up to 127 instead
of only up to 64. 127 is the maximum value allowed by the theora specification.

Originally committed as revision 19350 to svn://svn.ffmpeg.org/ffmpeg/trunk

7f57905d 06/05/2009 08:44 AM Baptiste Coudurier

vp3 and theora decoders use get_buffer, set CODEC_CAP_DR1

Originally committed as revision 19107 to svn://svn.ffmpeg.org/ffmpeg/trunk

f2264fa5 05/29/2009 09:43 PM David Conrad

Support block-level quantization in Theora

Originally committed as revision 18986 to svn://svn.ffmpeg.org/ffmpeg/trunk

ef516f73 05/22/2009 09:32 PM David Conrad

Move ALIGN macro to libavutil/common.h and use it in various places

Originally committed as revision 18898 to svn://svn.ffmpeg.org/ffmpeg/trunk

0a8dedc9 05/14/2009 12:02 AM David Conrad

Use skip_bits_long() for large skips
This fixes ogg/theora on ARM (more generally the A32 bitstream reader)

Originally committed as revision 18819 to svn://svn.ffmpeg.org/ffmpeg/trunk