Commit Graph

13641 Commits

Author SHA1 Message Date
Michael Niedermayer 9891004ba9 Merge remote branch 'qatar/master'
* qatar/master:
Partially merged:flvdec: Allow parsing keyframes metadata without seeking in most cases
  Error out if vaapi is not found
  avio: undeprecate av_url_read_fseek/fpause under nicer names
  libvo-*: Don't use deprecated sample format names and enum names
DUPLICATE  flvdec: Fix support for flvtool2 "keyframes based" generated index
DUPLICATE  libavcodec: Use "const enum AVSampleFormat[]" in AVCodec initialization
  Fix the conversion of AV_SAMPLE_FMT_FLT and _DBL to AV_SAMPLE_FMT_S32.
  Convert some undefined 1<<31 shifts into 1U<<31.

Conflicts:
	configure
	libavcodec/libvo-aacenc.c
	libavcodec/libvo-amrwbenc.c
	libavformat/flvdec.c

Marged-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-13 02:49:22 +02:00
Reimar Döffinger a0f17473b3 ASS decoder also requires ass_split.o to be compiled. 2011-04-13 00:56:18 +02:00
Carl Eugen Hoyos 5c0068758f Fix compilation with --disable-yasm. 2011-04-12 17:40:18 +02:00
Michael Niedermayer 8b7dc087e4 Add forgotten const to enum AVSampleFormat
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-12 14:26:18 +02:00
Martin Storsjö c5e03cebd3 libvo-*: Don't use deprecated sample format names and enum names
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-12 12:52:47 +03:00
Martin Storsjö c41eb2ade4 libavcodec: Use "const enum AVSampleFormat[]" in AVCodec initialization
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-12 12:38:37 +03:00
Carl Eugen Hoyos 4e54848bd1 Use const where appropriate.
Spotted by Reimar.
2011-04-12 08:55:20 +02:00
Carl Eugen Hoyos 72eb6dfe49 Mention VisualOn in the new codecs' long names to explain "libvo". 2011-04-12 08:51:58 +02:00
Alex Converse 2f072b55a4 Fix the conversion of AV_SAMPLE_FMT_FLT and _DBL to AV_SAMPLE_FMT_S32.
(1<<31) is undefined and seems to be evaluated by gcc to -2^31 when
these formulae require 2^31.

These conversions still need fate tests.
2011-04-11 21:47:53 -07:00
Alex Converse 187a537904 Convert some undefined 1<<31 shifts into 1U<<31.
According to ISO 9899:1999 S 6.5.7/4:

The result of E1 << E2 is E1 left-shifted E2 bit positions; vacated bits
are filled with zeros. If E1 has an unsigned type, the value of the
result is E1× 2^E2, reduced modulo one more than the maximum value
representable in the result type. If E1 has a signed type and
nonnegative value, and E1× 2^E2 is representable in the result type, then
that is the resulting value; otherwise, the behavior is undefined.
2011-04-11 21:47:42 -07:00
James Zern 8eeed0db05 vpxenc: add CQ_LEVEL mapping
via the equivalent AVCodecContext::crf modifying the range allowed by
options.c (0-51 -> 0-63)
update configure check to require libvpx 0.9.6 (Bali)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-12 03:54:28 +02:00
James Zern a299a261de vpxenc: add VP8E_SET_STATIC_THRESHOLD mapping
via the equivalent AVCodecContext::mb_threshold

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-12 03:53:56 +02:00
Michael Niedermayer 4727ec3c0e Merge remote branch 'qatar/master'
* qatar/master:
Not pulled due to wrong author, according to carl:  Add unconditional return statement to yuva420_rgb32_MMX() / yuva420_bgr32_MMX().
  Fix compilation of timefilter test program.
  Add support for AMR-WB encoding via libvo-amrwbenc
  Add an AAC encoder by using the libvo-aacenc library
  g722: Return 8 bits per sample for g722 in av_get_bits_per_sample

Conflicts:
	Changelog

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-12 03:48:21 +02:00
Aurelien Jacobs 13d4ec844a cosmetics: alignment 2011-04-12 02:02:35 +02:00
Aurelien Jacobs 6873cf9bc8 compute rects duration in ASS decoder
Signed-off-by: Aurelien Jacobs <aurel@gnuage.org>
2011-04-11 23:39:12 +02:00
Aurelien Jacobs 3ee8ca9b08 add avcodec_get_subtitle_defaults() to initialize AVSubtitle struct
Call this new function before decode() to replace the custom and
inconsistant initialization in various decoders.
This function is equivalent to avcodec_get_frame_defaults() for AVFrame.

Signed-off-by: Aurelien Jacobs <aurel@gnuage.org>
2011-04-11 23:27:50 +02:00
Martin Storsjö f502ff3f61 Add support for AMR-WB encoding via libvo-amrwbenc
The wrapper code is based on the libamr wrapper removed in SVN rev 19365.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-11 14:55:53 +03:00
Martin Storsjö d89e738a0c Add an AAC encoder by using the libvo-aacenc library
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-11 14:55:51 +03:00
Martin Storsjö 029f966c3a g722: Return 8 bits per sample for g722 in av_get_bits_per_sample
This fixes a failing assert in ff_raw_read_header (in
fate-g722dec-1), where bits_per_coded_sample is set using this
function and is required to have a positive value.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-11 11:35:43 +03:00
Michael Niedermayer ab8cfd45f8 Merge remote branch 'qatar/master'
* qatar/master:
  avio: add more documentation for AVIOContext.
  Parse sprite data for WMVP and WVP2, and decode sprites for the latter
  Replace outdated info on the FAQ
  Redefine sameq
  pad: fix example explanation
  gradfun: add notice from the MPlayer manual
  eval: add support for trunc, ceil, and floor functions
  documentation: add setdar and setsar description to filters.texi
  avio: document some members of AVIOContext.
  avio: document avio_close().
  avio: cosmetics, vertically align comments.
  avio: cosmetics, group the reading functions.
  avio: cosmetics, merge all the FF_API_OLD_AVIO blocks.
  avio: cosmetics, move AVIOContext to start of the file.
  avio: update file header.
  os: fix OpenBSD/PowerPC compilation
  pixfmt: add PIX_FMT_BGR48LE and PIX_FMT_BGR48BE
  oggdec: fix demuxing chained audio streams
  fix typo

Conflicts:
	doc/filters.texi
	libavformat/avio.h
	libavutil/pixfmt.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-11 04:08:08 +02:00
Michael Niedermayer df2d5b16ef H264: Allow templating hl_decode_mb based on pixel_size.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:42 +02:00
Michael Niedermayer 179106ed78 H264: factor if() out of coef decoding loop of decode_cabac_residual_internal()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:42 +02:00
Michael Niedermayer a50f0bea25 H264: Split out hl_motion and template it, this seems a bit faster
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:42 +02:00
Michael Niedermayer e7077f5e7b H264: replace pixel_size by pixel_shift
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:42 +02:00
Michael Niedermayer 9b271ce656 h264: Print bpp Signed-off-by: Michael Niedermayer <michaelni@gmx.at> 2011-04-10 22:33:42 +02:00
Oskar Arvidsson 5e85298cb5 Enable decoding of high bit depth h264.
This patch completes the high bit depth h264 decoding support.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:42 +02:00
Oskar Arvidsson 8dbe585641 Adds 8-, 9- and 10-bit versions of some of the functions used by the h264 decoder.
This patch lets e.g. dsputil_init chose dsp functions with respect to
the bit depth to decode. The naming scheme of bit depth dependent
functions is <base name>_<bit depth>[_<prefix>] (i.e. the old
clear_blocks_c is now named clear_blocks_8_c).

Note: Some of the functions for high bit depth is not dependent on the
bit depth, but only on the pixel size. This leaves some room for
optimizing binary size.

Preparatory patch for high bit depth h264 decoding support.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:42 +02:00
Oskar Arvidsson d268bed209 Add support for higher QP values in h264.
In high bit depth, the QP values may now be up to (51 + 6*(bit_depth-8)).

Preparatory patch for high bit depth h264 decoding support.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:42 +02:00
Michael Niedermayer 436c4523ed H264: fix prefetch
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:41 +02:00
Oskar Arvidsson dc172ecc6e Add the notion of pixel size in h264 related functions.
In high bit depth the pixels will not be stored in uint8_t like in the
normal case, but in uint16_t. The pixel size is thus 1 in normal bit
depth and 2 in high bit depth.

Preparatory patch for high bit depth h264 decoding support.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:41 +02:00
Oskar Arvidsson 86b0d9cd58 Make the h264 loop filter bit depth aware.
Preparatory patch for high bit depth h264 decoding support.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:41 +02:00
Oskar Arvidsson 63cc0e776e Template dsputil_internal.h with respect to pixel size, etc.
Preparatory patch for high bit depth h264 decoding support.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:41 +02:00
Oskar Arvidsson 9abd87bbc6 Template h264idct_internal.h with respect to pixel size, etc.
Preparatory patch for high bit depth h264 decoding support.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:41 +02:00
Oskar Arvidsson 2b092f7a14 Template h264pred_internal.h with respect to bit depth, etc.
Preparatory patch for high bit depth h264 decoding support.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:41 +02:00
Oskar Arvidsson 21a7c9366f Template h264dsp_internal.h with respect to pixel size, etc.
Preparatory patch for high bit depth h264 decoding support.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:41 +02:00
Oskar Arvidsson 8dffcca579 Move some functions in dsputil.c into a new file dsputil_internal.h.
The functions moved are used when decoding h264.
Preparatory patch for high bit depth h264 decoding support.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:41 +02:00
Oskar Arvidsson 7bc8032b07 Move the functions in h264idct into a new file h264idct_internal.h.
Preparatory patch for high bit depth h264 decoding support.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:41 +02:00
Oskar Arvidsson c2f38da901 Move the functions in h264pred.c into a new file h264pred_internal.h.
Preparatory patch for high bit depth h264 decoding support.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:41 +02:00
Oskar Arvidsson 2431689bb3 Move the functions in h264dsp.c into a new file h264dsp_internal.h
Preparatory patch for high bit depth h264 decoding support.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:41 +02:00
Oskar Arvidsson d4497f6dfb Add pixel formats for 9- and 10-bit yuv420p.
Also add support for these formats in libswscale.

Needed for high bit depth h264 decoding.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:41 +02:00
Oskar Arvidsson af0b2d6736 Choose h264 chroma dc dequant function dynamically.
Needed for high bit depth h264 decoding.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:33:41 +02:00
Michael Niedermayer 488efb33a7 H264: Fix slice threads
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 22:28:34 +02:00
Reimar Döffinger 701d0eb185 Fix input buffer size check in adpcm_ea decoder.
Unfortunately the output buffer size check assumes that the
input buffer is never over-consumed, thus this actually
also allowed to write outside the output buffer if "lucky".
2011-04-10 11:40:47 +02:00
Alberto Delmás 768c525114 Parse sprite data for WMVP and WVP2, and decode sprites for the latter
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-10 10:07:49 +02:00
pin xue 05c062e9da replace movw instruction in ac3dsp_armv6.S
AS      libavcodec/arm/ac3dsp_armv6.o
ffmpeg-src/libavcodec/arm/ac3dsp_armv6.S: Assembler messages:
ffmpeg-src/libavcodec/arm/ac3dsp_armv6.S:40: Error: selected processor
does not support `movw r8,#0x1fe0'
make[1]: *** [libavcodec/arm/ac3dsp_armv6.o] Error 1

MOVW is ARMv7 way to load constant:
   * movw, or move wide, will move a 16-bit constant into a register,
implicitly zeroing the top 16 bits of the target register.
   * movt, or move top, will move a 16-bit constant into the top half
of a given register without altering the bottom 16 bits
To load 32 bit constant, movw  lower16; movt upper16; is better than
ldr if available, because:
While this approach takes two instructions, it does not require any
extra space to store the constant so both the movw/movt method and the
ldr method will end up using the same amount of memory. Memory
bandwidth is precious in and the movw/movt approach avoids an extra
read on the data side, not to mention the read could have missed the
cache.

But here it is armv6 optimization, so that we have to use ldr.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-10 03:49:24 +02:00
Alexander Strange cf39b461d3 pthread: validate_thread_parameters() ignored slice-threading being intentionally off
The thread_type API allows you to request only FF_THREAD_FRAME (instead of
FRAME | SLICE), but it was being ignored.
We don't implement both of them at the same time, so there isn't an effect
on current codecs, except that you can request no kinds of threading now
(a bit useless).

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-04-09 08:23:22 -04:00
Reimar Döffinger f82163cf1c Use consistent condition for whether to run slice-threading execute function.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-04-09 08:23:22 -04:00
Gwenole Beauchesne da21440d46 vaapi: cope with VA-API 0.32, i.e. fix VC-1 decoding on Sandy Bridge.
(cherry picked from commit a18e7b4fb7)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-04-09 12:02:04 +02:00
Gwenole Beauchesne 09ce846206 vaapi: filter out DELAYED_PIC_REF flag to determine field.
This fixes ticket #23.

(cherry picked from commit 621f4c98df)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-04-09 12:00:57 +02:00
Philip Langdale ae7a4a1594 CrystalHD: Improve detection of h.264 content.
As previously discussed, the CrystalHD hardware returns exceptionally
useless information about interlaced h.264 content - to the extent
that it's not possible to distinguish most MBAFF and PAFF content until
it's too late.

In an attempt to compensate for this, I'm introducing two mechanisms:

1) Peeking at the picture number of the next picture

The hardware provides a capability to peek the next picture number. If
it is the same as the current picture number, then we are clearly dealing
with two fields and not a frame or fieldpair.

If this always worked, it would be all we need, but it's not guaranteed
to work. Sometimes, the next picture may not be decoded sufficiently
for the number to be known; alternately, a corruption in the stream may
cause the hardware to refuse to return the number even if the next
intact frame is decoded. In either case, the query will return 0.

If we are unable to peek the next picture number, we assume that the
picture is a frame/fieldpair and return it accordingly. If that turns
out to be incorrect, we discard the second field, and the user has
to live with the glitch. In testing, false detection can occur for
the first couple of seconds, and then the pipeline stabalizes and
we get correct detection.

2) Use the h264_parser to detect when individual input fields have
been combined into an output fieldpair.

I have multiple PAFF samples where this behaviour is detected. The
peeking mechanism described above will correctly detect that the
output is a fieldpair, but we need to know what the input type was
to ensure pipeline stability (only return one output frame per input
frame).

If we find ourselves with an output fieldpair, yet the input picture
type was a field, as reported by the parser, then we are dealing with
this case, and can make sure not to return anything on the next
decode() call.

Taken together, these allow us to remove the hard-coded hacks for
different h.264 types, and we can clearly describe the conditions
under which we can trust the hardware's claim that content is
interlaced.

Signed-off-by: Philip Langdale <philipl@overt.org>
2011-04-08 20:17:53 -07:00