Commit Graph

330 Commits

Author SHA1 Message Date
Michael Niedermayer 3c54e7ed4f Merge remote-tracking branch 'qatar/master'
* qatar/master:
  ac3enc: Add channel coupling support for the fixed-point AC-3 encoder.
  ac3enc: scale floating-point coupling channel coefficients in scale_coefficients() rather than in apply_channel_coupling()
  ac3enc: fix encoding of stereo ac3 files when rematrixing is disabled.
  wavpack: fix wrong return value in wavpack_decode_block()
  avconv: fix parsing metadata specifiers.
  fate: use +frame+slice named constants instead of '3'
  mpeg12: propagate more real return values through chunk decode error return and fix some indentation
  wavpack: use context reset in appropriate places
  avconv: move mux_preload and mux_max_delay to options context
  avconv: move bitstream filters to options context.
  avconv: move rate_emu to options context.
  avconv: move max_frames to options context.
  avconv: move metadata to options context.
  avconv: move ts scale to options context.
  avconv: move chapter maps to options context.
  avconv: move metadata maps to options context.
  avconv: move codec_names to options context.

Conflicts:
	avconv.c
	tests/fate-run.sh

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-05 22:29:16 +02:00
Justin Ruggles ae264bb29b ac3enc: Add channel coupling support for the fixed-point AC-3 encoder.
Update FATE references accordingly.
2011-09-05 10:09:44 -04:00
Michael Niedermayer d912e449b6 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  ac3enc: add macros for option names to make them more understandable.
  ac3enc: fix 'channel_coupling' option to actually allow 'auto'.
  cavs: fix some crashes with invalid bitstreams
  ac3enc: clip coupling coordinates during calculation
  Remove incorrect info in documentation of AVCodecContext.bits_per_raw_sample.
  lavc: fix parentheses placement in avcodec_open2().

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-11 20:39:20 +02:00
Justin Ruggles c766eb1ce1 ac3enc: add macros for option names to make them more understandable. 2011-08-11 11:33:32 -04:00
Justin Ruggles 9542ca9fb7 ac3enc: fix 'channel_coupling' option to actually allow 'auto'.
Use 'auto' as the default value.
2011-08-11 11:33:32 -04:00
Michael Niedermayer a9aa88df1d Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavc: make avcodec_init() static on next bump.
  ac3enc: remove unneeded #include
  ac3enc: restructure coupling coordinate reuse calculation
  ac3enc: allow new coupling coordinates to be sent independently for each channel.
  ac3enc: separate exponent bit counting from exponent grouping.
  h264: propagate error return values for AV_LOG_ERROR-triggering events
  aac: Don't attempt to output configure an invalid channel configuration.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-10 16:29:51 +02:00
Justin Ruggles c3d63262fe ac3enc: allow new coupling coordinates to be sent independently for each
channel.
2011-08-09 16:44:34 -04:00
Justin Ruggles d55ad59a8a ac3enc: separate exponent bit counting from exponent grouping.
Move bit counting to the bit allocation function. Move exponent grouping to
after bit allocation. This will allow for adjustment of bandwidth parameters
during bit allocation without having to do exponent grouping multiple times.
2011-08-09 16:28:18 -04:00
Michael Niedermayer 44187717c1 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  ppc: remove redundant setting of Altivec IDCT
  mpegvideo: initialise DSPContext in ff_dct_common_init()
  cosmetics: reindent
  eac3enc: support writing of basic mixing and info metadata
  dnxhdenc: fix declarations in for loops
  dsputil: remove stale bink prototypes and comments
  dsputil: move a bink-only function to binkdsp
  dsputil: remove some unused functions
  bink: make IDCT take 32-bit input

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-28 09:28:01 +02:00
Justin Ruggles 093ee8e199 cosmetics: reindent 2011-07-27 11:51:46 -04:00
Justin Ruggles 1bca72e1bd eac3enc: support writing of basic mixing and info metadata 2011-07-27 11:51:46 -04:00
Michael Niedermayer 4095fa9038 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  dnxhddec: optimise dnxhd_decode_dct_block()
  rtp: remove disabled code
  eac3enc: use different numbers of blocks per frame to allow higher bitrates
  dnxhd: add regression test for 10-bit
  dnxhd: 10-bit support
  dsputil: update per-arch init funcs for non-h264 high bit depth
  dsputil: template get_pixels() for different bit depths
  dsputil: create 16/32-bit dctcoef versions of some functions
  jfdctint: add 10-bit version
  mov: add clcp type track as Subtitle stream.
  mpeg4: add Mpeg4 Profiles names.
  mpeg4: decode Level Profile for MPEG4 Part 2.
  ffprobe: display bitstream level.
  imgconvert: remove unused glue and xglue macros

Conflicts:
	libavcodec/dsputil_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-22 12:08:52 +02:00
Justin Ruggles be7bd626c4 eac3enc: use different numbers of blocks per frame to allow higher bitrates 2011-07-21 14:57:10 -04:00
Michael Niedermayer 7c6c4cf2fb Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Remove h264_lowres_idct_put/add functions
  Remove snow/dwt test program
  h264: remove some disabled code
  Fix incorrect max_lowres values
  matroskadec: fix integer underflow if header length < probe length.
  cosmetics: indentation
  eac3enc: use frame exponent strategy when applicable.
  cosmetics: rename eac3dec_data.c/h to eac3_data.c/h since the tables will also be used in the E-AC-3 encoder.
  dsputil: fix ff_check_alignment()

Conflicts:
	libavcodec/Makefile
	libavcodec/h264idct_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-20 18:31:45 +02:00
Justin Ruggles 08a747afb9 eac3enc: use frame exponent strategy when applicable.
This checks if the set of selected exponent strategies for all blocks in a
channel are in the frame exponent strategy table, and if so, writes the
table index instead of each strategy. This saves up to 7 bits per channel per
frame, so the overall effect on quality is small.
2011-07-19 14:15:00 -04:00
Michael Niedermayer 80e4fe4063 Merge commit 'b5849f77095439e994b11c25e6063d443b36c228'
* commit 'b5849f77095439e994b11c25e6063d443b36c228': (21 commits)
  ac3enc: merge AC3MDCTContext with AC3EncodeContext.
  ac3enc: prefer passing AC3EncodeContext rather than AVCodecContext
  ac3enc: fix memleak
  mpeg1video: add CODEC_CAP_SLICE_THREADS.
  lavf: fix segfault in av_open_input_stream()
  mpegtsenc: set Random Access indicator on keyframe start packets
  lavf: Cleanup try_decode_frame() logic.
  Replace some gotos that lead to single return statements by direct return.
  build: move tests/seek_test.c to libavformat and reuse generic build rules
  mxfenc: include needed header for ff_iso8601_to_unix_time() prototype
  Add a check for strptime().
  lavf: factor out conversion of ISO8601 string to unix time
  wav: parse 'bext' metadata
  wav: keep parsing until EOF if the input is seekable and we know the size of the data tag
  wav: Refactor the tag checking into a switch statement
  wav: make sure neither data_size nor sample_count is negative.
  wav: refactor the 'fmt ' tag search and parsing.
  wav: add an option for writing BEXT chunk
  ffmpeg: get rid of a pointless limit on number of streams.
  ffmpeg: remove an unused define.
  ...

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-14 02:24:10 +02:00
Justin Ruggles b5849f7709 ac3enc: merge AC3MDCTContext with AC3EncodeContext.
Since both the fixed-point and floating-point encoders use the FFTContext,
this no longer needs to be in a separate context. Also, when a short-transform
context is added, the same MDCT window will be used.
2011-07-13 16:55:28 -04:00
Justin Ruggles 82cea7cb6c ac3enc: prefer passing AC3EncodeContext rather than AVCodecContext 2011-07-13 16:55:28 -04:00
Justin Ruggles f501157e53 ac3enc: fix memleak 2011-07-13 16:54:02 -04:00
Michael Niedermayer bb9d5171a7 Merge remote-tracking branch 'qatar/master'
* qatar/master: (21 commits)
  swscale: Add Doxygen for hyscale_fast/hScale.
  fate: enable lavfi-pixmt tests on big endian systems
  PPC: swscale: disable altivec functions for unsupported formats
  fate: merge identical pixdesc_be/le tests
  swscale: Add Doxygen for yuv2planar*/yuv2packed* functions.
  build: call texi2pod.pl with full path instead of symlink
  build: include sub-makefiles using full path instead of symlinks
  swscale: update big endian reference values after dff5a835.
  wavpack: skip blocks with no samples
  cosmetics: remove outdated comment that is no longer true
  build: replace some addprefix/addsuffix with substitution refs
  avutil: Remove unused arbitrary precision integer code.
  configure: Drop check for availability of ten assembler operands.
  aacenc: Save channel configuration for later use.
  aacenc: Fix codebook trellising for zeroed bands.
  swscale: change prototypes of scaled YUV output functions.
  swscale: re-add support for non-native endianness.
  swscale: disentangle yuv2rgbX_c_full() into small functions.
  swscale: split yuv2packed[12X]_c() remainders into small functions.
  swscale: split yuv2packedX_altivec in smaller functions.
  ...

Conflicts:
	Makefile
	configure
	libavcodec/x86/dsputil_mmx.c
	libavfilter/Makefile
	libavformat/Makefile
	libavutil/integer.c
	libavutil/integer.h
	libswscale/swscale.c
	libswscale/swscale_internal.h
	libswscale/x86/swscale_template.c
	tests/ref/lavfi/pixdesc_le
	tests/ref/lavfi/pixfmts_scale

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-29 05:23:12 +02:00
Justin Ruggles bd2deab706 cosmetics: remove outdated comment that is no longer true 2011-06-28 11:03:42 -04:00
Michael Niedermayer 7b7c47c8f7 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  ac3enc: move ff_ac3_encode_frame() to ac3enc_template.c
  ac3enc: merge log2_tab() into normalize_samples()
  ac3enc: Remove bit allocation fallbacks.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-28 02:30:04 +02:00
Justin Ruggles 8683c6a638 ac3enc: move ff_ac3_encode_frame() to ac3enc_template.c
This avoids using function pointers for quite a few small functions, most of
which just call DSP functions.
2011-06-27 12:59:39 -04:00
Justin Ruggles 7dcdf974d0 ac3enc: Remove bit allocation fallbacks.
They introduce too much complexity for very little benefit. The result is that
encoding will be more likely to fail at extremely low bitrates where quality
would be awful anyway.
2011-06-27 12:59:39 -04:00
Michael Niedermayer 4b87a088bf Merge remote-tracking branch 'qatar/master'
* qatar/master:
  configure: add --optflags option
  build: move documentation rules to doc/Makefile
  build: move test rules to tests/Makefile
  ac3enc: remove unneeded local variable in asym_quant()
  ac3enc: remove a branch in asym_quant() by doing 2 shifts
  ac3enc: avoid masking output in asym_quant() by using signed values for quantized mantissas.
  H.264: fix 4:4:4 + deblocking + 8x8dct + cavlc + MBAFF
  H.264: fix 4:4:4 + deblocking + MBAFF
  H.264: fix 4:4:4 cropping warning
  H.264: reference the correct SPS in decode_scaling_matrices
  H.264: fix bug in lossless 4:4:4 decoding

Conflicts:
	Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-23 04:49:04 +02:00
Justin Ruggles 684f4abfac ac3enc: remove unneeded local variable in asym_quant() 2011-06-22 12:18:10 -04:00
Justin Ruggles f21fb76b1b ac3enc: remove a branch in asym_quant() by doing 2 shifts 2011-06-22 12:18:10 -04:00
Justin Ruggles 0e4dbe2996 ac3enc: avoid masking output in asym_quant() by using signed values for
quantized mantissas.
2011-06-22 12:18:10 -04:00
Michael Niedermayer c137fdd778 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  swscale: remove misplaced comment.
  ffmpeg: fix streaming to ffserver.
  swscale: split out RGB48 output functions from yuv2packed[12X]_c().
  build: move vpath directives to main Makefile
  swscale: fix JPEG-range YUV scaling artifacts.
  build: move ALLFFLIBS to a more logical place
  ARM: factor some repetitive code into macros
  Fix SVQ3 after adding 4:4:4 H.264 support
  H.264: fix CODEC_FLAG_GRAY
  4:4:4 H.264 decoding support
  ac3enc: fix allocation of floating point samples.

Conflicts:
	ffmpeg.c
	libavcodec/dsputil_template.c
	libavcodec/h264.c
	libavcodec/mpegvideo.c
	libavcodec/snow.c
	libswscale/swscale.c
	libswscale/swscale_internal.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-15 02:15:25 +02:00
Michael Niedermayer 173cd695cb Merge remote-tracking branch 'qatar/master'
* qatar/master: (24 commits)
  utils: Drop pointless '#if 1' preprocessor directive.
  ac3enc: remove empty ac3_float function that is never called
  ac3enc: split templated float vs. fixed functions into a separate file.
  ac3enc: dynamically allocate AC3EncodeContext fields windowed_samples and mdct
  ac3enc: use function pointer to choose between AC-3 and E-AC-3 header output functions.
  Roll back 4:4:4 H.264 for now Needs some ARM/PPC asm modifications.
  Fix SVQ3 after adding 4:4:4 H.264 support
  H.264: fix CODEC_FLAG_GRAY
  4:4:4 H.264 decoding support
  h264_parser: Fix whitespace after previous change.
  h264_parser: Fix behaviour when PARSER_FLAG_COMPLETE_FRAMES is set.
  wav: remove an invalid free().
  lavf: initialise reference_dts in av_estimate_timings_from_pts.
  h264: don't be so picky on decoding pps in extradata.
  avcodec.h: add or elaborate on some documentation comments.
  h264: change a few comments into error messages
  ac3dec: fix doxy-style for comment ("///>" should be "///<" instead).
  img2: add .dpx to the list of supported file extensions.
  ffv1: fix undefined behavior with insane widths.
  ARM: jrevdct_arm: simplify stack usage
  ...

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-14 04:56:26 +02:00
Justin Ruggles 99477adc31 ac3enc: fix allocation of floating point samples.
sizeof(SampleType) is different for fixed and float encoders.
2011-06-13 17:49:37 -04:00
Justin Ruggles 38c304addd ac3enc: remove empty ac3_float function that is never called 2011-06-13 16:49:35 -04:00
Justin Ruggles e0cc66df61 ac3enc: split templated float vs. fixed functions into a separate file.
Function pointers are used for templated functions instead of needlessly
duplicating many functions.
2011-06-13 16:49:35 -04:00
Justin Ruggles e754dfc0bb ac3enc: dynamically allocate AC3EncodeContext fields windowed_samples and mdct
This will allow the same struct to be used for both the fixed and float ac3
encoders.
2011-06-13 16:49:35 -04:00
Justin Ruggles 36151b3e31 ac3enc: use function pointer to choose between AC-3 and E-AC-3 header output
functions.
2011-06-13 16:49:35 -04:00
Michael Niedermayer d552f616a2 Merge remote-tracking branch 'qatar/master'
* qatar/master: (28 commits)
  Remove some non-compiling debug messages.
  ffplay: Fix non-compiling debug printf and replace it by av_dlog.
  H264: x86 predict init cosmetics.
  ac3enc: Fix linking of AC-3 encoder without the E-AC-3 encoder.
  Move E-AC-3 encoder functions to a separate eac3enc.c file.
  ac3enc: remove convenience macro, #define DEBUG
  ac3enc: remove unused #define
  vc1: re-initialize tables after width/height change.
  APIchanges: fill-in git commit hash for av_get_bytes_per_sample() addition
  samplefmt: add av_get_bytes_per_sample()
  iirfilter: fix biquad filter coefficients.
  swscale: remove duplicate conversion routine in swScale().
  swscale: add yuv2planar/packed function typedefs.
  swscale: integrate yuv2nv12X_C into yuv2yuvX() function pointers.
  swscale: reindent x86 init code.
  swscale: extract SWS_FULL_CHR_H_INT conditional into init code.
  swscale: cosmetics.
  swscale: remove alp/chr/lumSrcOffset.
  swscale: un-special-case yuv2yuvX16_c().
  shorten: Remove stray DEBUG #define and corresponding av_dlog statement.
  ...

Conflicts:
	doc/APIchanges
	libavcodec/ac3enc.c
	libavutil/avutil.h
	libavutil/samplefmt.c
	libswscale/swscale.c
	libswscale/swscale_internal.h
	libswscale/x86/swscale_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-08 05:25:28 +02:00
Diego Biurrun d3778972d8 ac3enc: Fix linking of AC-3 encoder without the E-AC-3 encoder.
The AC-3 encoder unconditionally references some symbols from the E-AC-3
encoder; make those references conditional to fix linking.
2011-06-08 00:06:19 +02:00
Justin Ruggles c8e9ea43d0 Move E-AC-3 encoder functions to a separate eac3enc.c file. 2011-06-07 15:16:41 -04:00
Justin Ruggles 787a13535a ac3enc: remove convenience macro, #define DEBUG 2011-06-07 15:16:41 -04:00
Justin Ruggles a8bd53402a ac3enc: remove unused #define 2011-06-07 15:16:41 -04:00
Michael Niedermayer f9569249c2 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Remove some unused scripts from tools/.
  Add x86 assembly for some 10-bit H.264 intra predict functions.
  v4l2: do not force NTSC as standard
  Skip tableprint.h during 'make checkheaders'.
  Remove unnecessary LIBAVFORMAT_BUILD #ifdef.
  Drop explicit filenames from @file Doxygen tags.
  Skip generated table headers during 'make checkheaders'.
  lavf,lavc: free avoptions in a generic way.
  AVOptions: add av_opt_free convenience function.
  tableprint: Restore mistakenly deleted common.h #include for FF_ARRAY_ELEMS.
  tiff: print log in case of unknown / unsupported tag.
  tiff: fix linesize for mono-white/black formats.
  Fix build of eval-test program
  configure: Document --enable-vaapi
  ac3enc: extract all exponents for the frame at once

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-06 03:33:58 +02:00
Justin Ruggles 35d5cb1ab4 ac3enc: extract all exponents for the frame at once 2011-06-04 19:08:37 -04:00
Michael Niedermayer b8a43bc1b5 Merge remote-tracking branch 'qatar/master' into master
* qatar/master: (27 commits)
  ac3enc: fix LOCAL_ALIGNED usage in count_mantissa_bits()
  ac3dsp: do not use the ff_* prefix when referencing ff_ac3_bap_bits.
  ac3dsp: fix loop condition in ac3_update_bap_counts_c()
  ARM: unbreak build
  ac3enc: modify mantissa bit counting to keep bap counts for all values of bap instead of just 0 to 4.
  ac3enc: split mantissa bit counting into a separate function.
  ac3enc: store per-block/channel bap pointers by reference block in a 2D array rather than in the AC3Block struct.
  get_bits: add av_unused tag to cache variable
  sws: replace all long with int.
  ARM: aacdec: fix constraints on inline asm
  ARM: remove unnecessary volatile from inline asm
  ARM: add "cc" clobbers to inline asm where needed
  ARM: improve FASTDIV asm
  ac3enc: use LOCAL_ALIGNED macro
  APIchanges: fill in git hash for av_get_pix_fmt_name (0420bd7).
  lavu: add av_get_pix_fmt_name() convenience function
  cmdutils: remove OPT_FUNC2
  swscale: fix crash in bilinear scaling.
  vpxenc: add VP8E_SET_STATIC_THRESHOLD mapping
  webm: support stereo videos in matroska/webm muxer
  ...

Conflicts:
	Changelog
	cmdutils.c
	cmdutils.h
	doc/APIchanges
	doc/muxers.texi
	ffmpeg.c
	ffplay.c
	libavcodec/ac3enc.c
	libavcodec/ac3enc_float.c
	libavcodec/avcodec.h
	libavcodec/get_bits.h
	libavcodec/libvpxenc.c
	libavcodec/version.h
	libavdevice/libdc1394.c
	libavformat/matroskaenc.c
	libavutil/avutil.h
	libswscale/rgb2rgb.c
	libswscale/swscale.c
	libswscale/swscale_template.c
	libswscale/x86/swscale_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-29 03:34:35 +02:00
Mans Rullgard 90da52f01f ac3enc: fix LOCAL_ALIGNED usage in count_mantissa_bits()
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-05-28 21:42:31 +01:00
Justin Ruggles 6ca23db9cc ac3enc: modify mantissa bit counting to keep bap counts for all values of bap
instead of just 0 to 4.

This does all the actual bit counting as a final step.
2011-05-28 12:39:28 -04:00
Justin Ruggles 1323828a0f ac3enc: split mantissa bit counting into a separate function.
No speed difference. This is to allow for more flexible bit counting.
2011-05-28 12:39:28 -04:00
Justin Ruggles 7743865ffc ac3enc: store per-block/channel bap pointers by reference block in a 2D array
rather than in the AC3Block struct.

This will make it easier to access the bap values without having to chase
the reference block pointers each time.
2011-05-28 12:39:28 -04:00
Mans Rullgard 7f7726c7a2 ac3enc: use LOCAL_ALIGNED macro
Aligned local variables must use the LOCAL_ALIGNED macro to ensure
correct alignment on all systems.  The unusual size argument to
memset is required since the implementation of LOCAL_ALIGNED may
use a pointer to an array.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-05-28 15:00:16 +01:00
Justin Ruggles 1a950da6a2 cosmetics: indentation and alignment after previous commit 2011-05-27 16:25:22 -04:00
Justin Ruggles aa47c35dff ac3enc: add support for E-AC-3 encoding.
This adds basic stream format support and allows for arbitrary bit rates
rather than just those supported in AC-3.
2011-05-27 16:25:22 -04:00