Justin Ruggles
c05ffcd9ba
Change planar_samples from int16_t to SampleType.
...
This one was missed in r26174.
Originally committed as revision 26179 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
0cbd5ff704
Add typedefs and a macro that will allow sharing of functions between the
...
fixed-point and floating-point AC-3 encoders.
Originally committed as revision 26174 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
b33dae5efb
Move the list of supported channel layouts to a separate table.
...
Originally committed as revision 26173 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
34d5074e6d
Add a window field to AC3MDCTContext and use it as an input to apply_window()
...
instead of using the ff_ac3_window[] table directly.
Originally committed as revision 26172 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
b5293036b9
cosmetics: alignment, line wrap, and spacing
...
Originally committed as revision 26171 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
14166a6d6c
Remove avctx from AC3MDCTContext and just pass it to mdct_init() instead.
...
Originally committed as revision 26170 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
e0698e4bbd
Make exponent_group_tab[] static.
...
Originally committed as revision 26169 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
ec44dd5fc2
Change the default dB-per-bit code from 2 to 3.
...
This gives slightly better quality in PEAQ tests.
Code 3 gives a dBpb value of 2816 = -132dB (128 psd units = -6dB), which
corresponds to 22 bits. Since the exponents have an offset applied, the
16-bit source looks like 24-bit source to the bit allocation routine.
So using dBpb code=3 is a closer match to the exponent range.
Regression test refs updated for acodec-ac3, lavf-rm, and seek-ac3_rm.
Originally committed as revision 26144 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
b51c740eab
cosmetics: line wrap and vertical alignment
...
Originally committed as revision 26084 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
e96dc767e4
Make sure that the 2nd CRC value does not match the AC-3 sync word.
...
This is optional for encoders, but it's a good idea and has minimal impact
on performance.
This will change the output for some files, but it happens not to affect the
regression tests.
Originally committed as revision 26083 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
a897423baa
Store CRC context locally to reduce number of calls to av_crc_get_table().
...
Originally committed as revision 26082 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
0e9b064305
Remove unneeded local variable, frame_size, in output_frame_end().
...
Originally committed as revision 26081 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
1ce9d6b85f
cosmetics: fix comment after change in clipping range
...
Originally committed as revision 26072 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
295ab2af6e
Change FIX15() back to clipping to -32767..32767.
...
This avoids a 16-bit overflow in mdct512() due to a -32768 value in costab.
References updated for acodec-ac3, lavf-rm, and seek-ac3_rm tests.
Thanks to Måns Rullgård for finding the bug.
Originally committed as revision 26071 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
f9f69028af
Add emms_c() after exp_diff calculations.
...
Fixes AC-3 encoding on OpenBSD 4.8 x86_32 and hopefully other similar
configurations.
Originally committed as revision 26070 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
a81d7c6aa3
Pre-calculate crc_inv at codec init.
...
20% faster output_frame_end().
Originally committed as revision 26069 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
386268dfff
Add some simple fallbacks for normal bit allocation failure.
...
This allows encoding with lower bitrates by decreasing exponent bits first,
then decreasing bandwidth if the user did not specify a specific cutoff
frequency.
Originally committed as revision 26050 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
e62ef8f2db
Check user-specified cutoff frequency in validate_options().
...
Originally committed as revision 26049 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
78646ac206
10l: fix encoding for LFE channel
...
Originally committed as revision 26048 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
86c9673bab
Add support for fixed-point MDCT sizes other than 512.
...
Originally committed as revision 26046 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
234b70d346
cosmetics: reindent after last commit
...
Originally committed as revision 26045 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
98e34e71c0
Simplify bit allocation search by using a loop for the SNR offset increment.
...
Originally committed as revision 26044 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
cf7c961b19
Do not calculate psd and masking curve if exponents are being reused.
...
Approx. 20% faster in function bit_alloc_masking().
Originally committed as revision 26042 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
68e6b0990d
cosmetics: reindent after last commit
...
Originally committed as revision 26041 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
795063db3b
Copy bap from previous block when exponent strategy is EXP_REUSE.
...
We can do this because exponents are the only bit allocation parameters which
change from block-to-block currently.
Approx. 57% faster in function bit_alloc().
Approx. 25% faster overall encoding.
Originally committed as revision 26040 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
126a29b871
Count grouped mantissas for each block all at once at the end of bit
...
allocation for each block.
24% faster in function bit_alloc(). Approx. 10% faster overall encoding.
Originally committed as revision 26039 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
e7536ac567
Count bits for fixed parameters at start of encoding rather than in every
...
frame.
Originally committed as revision 26038 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
e86ea34dad
Use a LUT for number of exponent groups. This avoids recalculating it for
...
every block and channel for every frame.
Originally committed as revision 26037 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
834550ea0d
Speed up group minimum and group output calculations for EXP_D25 and EXP_D45
...
in encode_exponents_blk_ch() by removing the inner loops. This is about 30-40%
faster for the modified sections.
Originally committed as revision 26036 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
cdedf7e625
Convert a for() loop into a while() loop for the downward part of the exponent
...
delta limiting.
Originally committed as revision 26035 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
27af78cf0e
Redesign encode_exponents_blk_ch() so that duplicate exponent sets are no
...
longer required. This gets rid of the temp buffer as well as encoded_exp in
AC3EncodeContext. It also allows for skipping the exponent grouping for
EXP_D15. 56% faster in encode_exponents_blk_ch().
Originally committed as revision 26034 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
8846ee54ad
Use optimized function DSPContext.sad[0]() instead of calc_exp_diff().
...
90% faster compute_exp_strategy().
Originally committed as revision 26033 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
7786c384f6
cosmetics: pretty-printing after last commit
...
Originally committed as revision 26031 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
89bedc4d2e
Add a goto for init failure instead of duplicate calls to ac3_encode_close().
...
Originally committed as revision 26030 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
c41ac4f82e
Use pre-allocated temp buffers in mdct512().
...
5% faster in function.
Originally committed as revision 26029 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
e29065f7bf
Write results of post-rotation complex multiply directly to output.
...
2% faster in function mdct512().
Originally committed as revision 26028 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
9d8533368f
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
14 years ago
Justin Ruggles
b6f6204db9
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
14 years ago
Justin Ruggles
aa645b9888
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
14 years ago
Justin Ruggles
e8d21fba3f
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
14 years ago
Justin Ruggles
171bc51c9b
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
cbr_bit_allocation().
Originally committed as revision 26023 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
1c3e117e0b
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
14 years ago
Justin Ruggles
7eeca961e3
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
14 years ago
Justin Ruggles
2d82d9b1df
cosmetics: comment clean-up and misc cosmetics
...
Originally committed as revision 26019 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
5901cebecd
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
14 years ago
Justin Ruggles
cb6247cb30
Split bit allocation search into a separate function.
...
Originally committed as revision 26017 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
06f6f78578
10l: fix typo in compute_exp_strategy()
...
Originally committed as revision 26013 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
266d24be4a
Move large arrays to AC3EncodeContext rather than passing them around.
...
Originally committed as revision 26012 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
7da4dc17d9
cosmetics: line wrap and spacing
...
Originally committed as revision 26011 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Justin Ruggles
a0d763fc88
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
14 years ago