Statistics
| Branch: | Revision:

ffmpeg / libavcodec / ac3enc.c @ 9d853336

History | View | Annotate | Download (56.1 KB)

# Date Author Comment
9d853336 12/16/2010 03:13 AM Justin Ruggles

Use memcpy() instead of a for loop in mdct512().
8% faster in function.

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

b6f6204d 12/16/2010 02:33 AM Justin Ruggles

Allocate all large per-channel arrays using av_malloc().
Decreases memory usage for less than 6 channels.

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

aa645b98 12/16/2010 02:32 AM Justin Ruggles

Make windowed_samples 16-byte aligned.
This will allow future SIMD optimization of the window function.

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

e8d21fba 12/16/2010 02:32 AM Justin Ruggles

Allocate planar_samples using av_mallocz().
Lowers memory usage when encoding less than 6 channels.

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

171bc51c 12/15/2010 09:12 PM Justin Ruggles

Allocate bap and bap1 buffers using av_malloc().
This reduces the memory footprint when using less than 6 channels.
Modify bit allocation to swap the 2 buffers instead of using memcpy() and use
per-block pointers for bap. This is slightly faster (0.3%) in function...

1c3e117e 12/15/2010 05:28 PM Justin Ruggles

Remove last_samples[] and copy directly from planar_samples[].
Avoids memcpy that was used to store last samples for next frame.
Approx. 3% faster in function deinterleave_input_samples() and reduces memory
usage by 3kB.

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

7eeca961 12/15/2010 05:28 PM Justin Ruggles

Remove unneeded line. key_frame is already set to 1 in avcodec_alloc_frame().

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

2d82d9b1 12/15/2010 05:28 PM Justin Ruggles

cosmetics: comment clean-up and misc cosmetics

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

5901cebe 12/15/2010 05:28 PM Justin Ruggles

Separate most of the per-block arrays into a separate per-block struct.

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

cb6247cb 12/15/2010 05:28 PM Justin Ruggles

Split bit allocation search into a separate function.

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

06f6f785 12/14/2010 10:45 PM Justin Ruggles

10l: fix typo in compute_exp_strategy()

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

266d24be 12/14/2010 10:45 PM Justin Ruggles

Move large arrays to AC3EncodeContext rather than passing them around.

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

7da4dc17 12/14/2010 10:45 PM Justin Ruggles

cosmetics: line wrap and spacing

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

a0d763fc 12/14/2010 10:45 PM Justin Ruggles

Use a single value for SNR offset in the bit allocation search rather than
the separate coarse and fine values.

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

70fcd7ea 12/14/2010 10:45 PM Justin Ruggles

Change bit_alloc() to return the mantissa bit count.

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

937cd146 12/14/2010 10:45 PM Justin Ruggles

cosmetics: alignment and line wrap after last commit

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

359c1d19 12/14/2010 10:45 PM Justin Ruggles

Move bit counts to AC3EncodeContext.

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

793bbf95 12/14/2010 02:53 PM Justin Ruggles

Split out setting of bit allocation parameters to a separate function.
Th new function only needs to be called at initialization because bit
allocation parameters currently do not change during encoding.

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

8999944e 12/14/2010 02:53 PM Justin Ruggles

Split out counting of frame bits into a separate function.

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

33a7d549 12/14/2010 02:53 PM Justin Ruggles

cosmetics: vertical alignment

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

d3325d55 12/14/2010 02:53 PM Justin Ruggles

Only calculate num_exp_groups once.

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

dc0bc0f8 12/14/2010 02:53 PM Justin Ruggles

Check for bit allocation error in ac3_encode_frame().
Move error log printout to ac3_encode_frame().

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

f94bacc5 12/14/2010 02:53 PM Justin Ruggles

Split out grouping of exponents into a separate function.

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

b6a1e523 12/14/2010 02:53 PM Justin Ruggles

Split out mantissa quantization into separate functions.

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

5b44ede0 12/14/2010 02:53 PM Justin Ruggles

cosmetics: rearrange some functions

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

d7da8080 12/14/2010 02:53 PM Justin Ruggles

Reverse the exponent & exponent strategy array arrangement to simplify the
per-channel exponent strategy decision. This will also make it easier to
plug-in other exponent strategy algorithms.

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

67d979fe 12/14/2010 02:53 PM Justin Ruggles

Move writing of frame to the output bitstream to a separate function.

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

084f5c5a 12/14/2010 02:53 PM Justin Ruggles

cosmetics: remove a comment and just spacing

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

160d85f5 12/14/2010 02:53 PM Justin Ruggles

Split frame size adjustment into a separate function.

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

dfdf73eb 12/14/2010 02:53 PM Justin Ruggles

Split exponent processing into separate functions.

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

0a0a8500 12/14/2010 02:52 PM Justin Ruggles

Split applying of MDCT into several separate functions.

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

4acc790f 12/14/2010 02:52 PM Justin Ruggles

Split input sample deinterleaving into a separate function.

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

152cc528 12/14/2010 02:52 PM Justin Ruggles

Separate functionally different calculations in ac3_encode_frame().

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

98f6ee44 12/14/2010 02:52 PM Justin Ruggles

cosmetics: rename 2 variables

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

12ed6226 12/14/2010 02:52 PM Justin Ruggles

Deinterleave whole frame at once instead of per-block.
This reduces the amount of memcpy() by using pointers to overlap samples for
successive blocks rather than copying.

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

e0685bc9 12/14/2010 02:52 PM Justin Ruggles

cosmetics: add & alter some comments

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

282255bb 12/14/2010 02:52 PM Justin Ruggles

Split setting of bandwidth into a separate function.

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

e35c984a 12/14/2010 02:52 PM Justin Ruggles

Move setting of bitstream_id and bitstream_mode to ac3_encode_init().

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

ddf63d37 12/14/2010 02:52 PM Justin Ruggles

Improve ac3_encode_init() error reporting.
Return AVERROR instead of -1. Propogate errors from called functions.
Add some error log printouts.

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

b64d842c 12/14/2010 02:52 PM Justin Ruggles

cosmetics: indent after last commit

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

99ca4f73 12/14/2010 02:52 PM Justin Ruggles

Don't use nested loops to iterate valid sample rates.
Eliminates a goto and mirrors the bitrate validation.

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

1607db0a 12/14/2010 02:52 PM Justin Ruggles

Remove some duplicate local copies of avctx fields.
This is an av_cold function, and we don't need to duplicate variables just to
save a few characters.

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

8f60f70d 12/14/2010 02:52 PM Justin Ruggles

Split validation of initial user options into a separate function.

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

427e2293 12/14/2010 02:52 PM Justin Ruggles

Use bytes instead of 16-bit words for frame size.

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

eed00252 12/14/2010 02:52 PM Justin Ruggles

cosmetics: rename variable 'n' to 'pad_bytes'

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

1971ab6e 12/14/2010 02:52 PM Justin Ruggles

Change output_frame_end() to return void. The frame size is already known.

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

e8b552a8 12/14/2010 02:52 PM Justin Ruggles

cosmetics: pretty-printing

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

ce67b7cd 12/14/2010 02:52 PM Justin Ruggles

cosmetics: rename some iterator variables to match what they represent

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

77773275 12/14/2010 02:51 PM Justin Ruggles

cosmetics: rename a variable for consistency

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

aab45ca3 12/14/2010 02:51 PM Justin Ruggles

cosmetics: rename exp_samples and global_exp to exp_shift.

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

23c5b361 12/14/2010 02:51 PM Justin Ruggles

cosmetics: rename 2 functions

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

47ae6e79 12/14/2010 02:51 PM Justin Ruggles

define AC3_CRITICAL_BANDS and use it in the AC-3 encoder and decoder.

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

0454b558 12/14/2010 02:51 PM Justin Ruggles

Use sizeof(array value) instead of sizeof(int16_t).

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

a0a9204e 12/14/2010 02:51 PM Justin Ruggles

cosmetics: use lowercase letters for function names

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

c36ce0f8 12/14/2010 02:51 PM Justin Ruggles

cosmetics: add new function documentation and clean up existing documentation

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

2f8ae522 12/14/2010 02:51 PM Justin Ruggles

cosmetics: add more space between functions

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

e77fd066 12/14/2010 02:51 PM Justin Ruggles

cosmetics: rearrange some functions/typedefs/macros

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

02877def 12/14/2010 02:51 PM Justin Ruggles

Simplify group size calculation in 2 places.

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

98161553 12/14/2010 02:51 PM Justin Ruggles

cosmetics: make a switch/case more compact

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

b84a211b 12/14/2010 02:51 PM Justin Ruggles

Clean up fft_init() and mdct_init()

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

6a988808 12/14/2010 02:51 PM Justin Ruggles

cosmetics: pretty-printing, alignment, etc...

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

a913b5cf 12/14/2010 02:51 PM Justin Ruggles

Remove unneeded #include

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

918cd225 12/14/2010 02:51 PM Justin Ruggles

Simplify fix15().
Turn it into 2 macros, and use av_clip_int16() and lrintf().
This matches the int16 to float sample conversion in audioconvert.c.
The regression test output is different due to lrintf() rounding.

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

228315bb 12/14/2010 02:50 PM Justin Ruggles

Fix the fixed-point MDCT and FFT tests so that they actually compile and work.

Also, use LFG from libavutil instead of random().

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

a8d2b06b 12/14/2010 02:50 PM Justin Ruggles

Split out initialization of MDCT tables into a separate function.

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

07965463 12/14/2010 02:50 PM Justin Ruggles

cosmetics: Document AC3EncodeContext fields.

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

22c0b03c 12/14/2010 02:50 PM Justin Ruggles

Remove unneeded debugging messages.

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

1fda2c10 12/14/2010 02:50 PM Justin Ruggles

cosmetics: Define AC3_WINDOW_SIZE and use it instead of AC3_BLOCK_SIZE*2.

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

7066cc8f 12/14/2010 02:50 PM Justin Ruggles

cosmetics: use better (and shared) macro names for some constant values

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

a657899c 12/14/2010 02:50 PM Justin Ruggles

Remove duplicate AC3EncodeContext fields, sr_shift and sr_code.

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

2d2692eb 12/14/2010 02:50 PM Justin Ruggles

cosmetics: rename some fields in AC3EncodeContext

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

9cb59032 12/14/2010 02:50 PM Justin Ruggles

cosmetics: change all short to int16_t

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

2be209b2 12/14/2010 02:50 PM Justin Ruggles

Change some unsigned types to signed types in AC3EncodeContext

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

7e5a4bf8 12/14/2010 02:50 PM Justin Ruggles

cosmetics: rearrange AC3EncodeContext fields

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

63e8d976 11/21/2010 08:06 PM Stefano Sabatini

Use the new libavcore audio channel API.

This also allows to remove a linking dependency of libavfilter on
libavcodec.

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

5d6e4c16 11/12/2010 11:04 AM Stefano Sabatini

Replace deprecated symbols SAMPLE_FMT_* with AV_SAMPLE_FMT_*, and enum
SampleFormat with AVSampleFormat.

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

edac49da 07/24/2010 01:59 PM Reimar Döffinger

Use "const" qualifier for pointers that point to input data of
audio encoders.
This is purely for clarity/documentation purposes.

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

8fc0162a 07/10/2010 10:12 PM Måns Rullgård

Add av_ prefix to bswap macros

Originally committed as revision 24170 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

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

91cc5d37 11/09/2009 09:11 AM Francesco Lavra

Move ff_reverse in libavcodec to av_reverse in libavutil.

Patch by Francesco Lavra, francescolavra interfree it

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

b5f09d31 09/06/2009 09:15 AM Reimar Döffinger

Make sample_fmts and channel_layouts compound literals const to reduce size of
.data section.

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

8b44de14 07/30/2009 09:00 PM Diego Biurrun

Change av_log() calls surrounded by '#ifdef DEBUG' into dprintf macros.

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

be1efe59 04/20/2009 12:34 AM Justin Ruggles

ac3enc: log a warning message if the channel layout is not specified at
the time of codec initialization.

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

120b4557 04/19/2009 03:06 PM Justin Ruggles

Add channel layout support to the AC-3 encoder.

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

a7c6e117 04/17/2009 08:39 AM Justin Ruggles

ac3enc: reorder input channels to AC-3 channel order

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

fb53b4a0 04/13/2009 04:59 PM Stefano Sabatini

Rename pbBufPtr() to put_bits_ptr().
The new name is more readable and consistent with the FFmpeg naming
style.

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

9106a698 04/13/2009 04:20 PM Stefano Sabatini

Rename bitstream.h to get_bits.h.

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

b2755007 04/12/2009 08:35 AM Stefano Sabatini

Split bitstream.h, put the bitstream writer stuff in the new file
put_bits.h.

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

27127202 03/05/2009 10:17 PM Diego Biurrun

Remove duplicated MUL16 macro definition, fixes the warning:
libavcodec/ac3enc.c:119:1: warning: "MUL16" redefined

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

5ef251e5 02/22/2009 01:48 PM Daniel Verkamp

Add missing av_cold in static init/close functions.

Patch by Daniel Verkamp daniel at drv dot nu.

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

bad5537e 02/01/2009 02:00 AM Diego Biurrun

Use full internal pathname in doxygen @file directives.
Otherwise doxygen complains about ambiguous filenames when files exist
under the same name in different subdirectories.

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

406792e7 01/19/2009 03:46 PM Diego Biurrun

cosmetics: Remove pointless period after copyright statement non-sentences.

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

2988c93d 09/01/2008 02:33 PM Justin Ruggles

create a separate codec_id for E-AC-3

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

bf09b550 08/20/2008 12:32 AM Justin Ruggles

commit the OKed parts of the E-AC-3 decoder

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

14b70628 08/03/2008 04:42 PM Justin Ruggles

cosmetics: make all references to AC-3 capitalized and hyphenated

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

fd76c37f 07/31/2008 10:47 AM Peter Ross

Modify all codecs to report their supported input and output sample format(s).

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

cf2baeb3 06/24/2008 08:01 PM Stefan Gehrer

mark read-only data as const

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

fe4bf374 06/12/2008 09:50 PM Stefano Sabatini

Make AVCodec long_names definition conditional depending on CONFIG_SMALL.

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

687671f0 06/07/2008 10:29 PM Justin Ruggles

pass bap table to ff_ac3_bit_alloc_calc_bap()

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