Commit Graph

13622 Commits

Author SHA1 Message Date
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
Philip Langdale
bfde0f1b3d CrystalHD: Carry picture type from input to output picture.
Now that we know the type of the input picture, we have to bring
that information to the output picture to help identify its type.
We do this by adding a field to the opaque_list node.

Signed-off-by: Philip Langdale <philipl@overt.org>
2011-04-08 20:17:50 -07:00
Philip Langdale
f6421e0b5c CrystalHD: Bring in h.264 parser to establish picture type.
As the hardware is unreliable, we will have to use the h.264 parser
to identify whether an input picture is a field or a frame. This
change loads the parser and extracts the picture type.

Signed-off-by: Philip Langdale <philipl@overt.org>
2011-04-08 20:17:47 -07:00
Philip Langdale
e99fd6ee19 CrystalHD: Change opaque_list_pop to return the node.
In preparation for adding additional fields to the node, return
the node instead of the pts value. This requires the caller to
free the node.

Signed-off-by: Philip Langdale <philipl@overt.org>
2011-04-08 20:17:42 -07:00
Philip Langdale
ca0eed7e37 CrystalHD: Fix whitespace after previous change.
'git diff -w' confirmed to return nothing.

Signed-off-by: Philip Langdale <philipl@overt.org>
2011-04-08 20:17:39 -07:00
Philip Langdale
9ce1d5f03b CrystalHD: Handle different h.264 MBAFF packing.
I found another MBAFF sample where the input:output pattern is
the same as mpeg2 and vc1 (fieldpair input, individual field output).
While I'm not sure how you can output individual fields from MBAFF,
if I apply the mpeg2/vc1 handling to this file, it plays correctly.

So, this changes the detection algorithm to handle the known cases.

Whitespace will be fixed in a separate change.

Signed-off-by: Philip Langdale <philipl@overt.org>
2011-04-08 20:17:35 -07:00
Michael Niedermayer
a61bc91d42 Fix ticket21, temporary audio array was too small.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-09 01:00:44 +02:00
Michael Niedermayer
9d4cb45dbe Cleanup 'Fix spurious warning when stream has SPS and PPS units.'
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-08 12:29:30 +02:00
Alexander Strange
d0df2934ca Merge remote-tracking branch 'ffmpeg-mt/master'
* ffmpeg-mt/master:
DUPLICATE mingw32 compilation after 'unbreak avcodec_thread_init'
      pthread: validate_thread_parameters() ignored slice-threading being intentionally off
DUPLICATE Remove unnecessary parameter from ff_thread_init() and fix behavior

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-08 03:03:03 +02:00
Michael Niedermayer
c88caa522c Merge remote branch 'qatar/master'
* qatar/master:
  proto: include os_support.h in network.h
  matroskaenc: don't write an empty Cues element.
  lavc: add a FF_API_REQUEST_CHANNELS deprecation macro
  avio: move extern url_interrupt_cb declaration from avio.h to url.h
  avio: make av_register_protocol2 internal.
  avio: avio_ prefix for url_set_interrupt_cb.
  avio: AVIO_ prefixes for URL_ open flags.
  proto: introduce listen option in tcp
  doc: clarify configure features
  proto: factor ff_network_wait_fd and use it on udp

Conflicts:
	ffmpeg.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-08 02:50:13 +02:00
Michael Niedermayer
ffb61814a0 Fix deblocking with thread_slices
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-08 00:20:18 +02:00
Anton Khirnov
9f5ddd1e46 lavc: add a FF_API_REQUEST_CHANNELS deprecation macro
And hide request_channels AVOption under it.
2011-04-07 18:11:24 +02:00
Michael Niedermayer
c0e51ec9c6 Merge remote branch 'qatar/master'
* qatar/master:
  Fix parser: mark av_parser_parse() for removal on next major bump
  swscale: postpone sws_getContext removal until next major bump.
  fate: add AAC LATM test
  mmst: get rid of deprecated AVERRORs
  lxfdec: use AVERROR(ENOMEM) instead of deprecated AVERROR_NOMEM.
  Reemove remaining uses of deprecated AVERROR_NOTSUPP.
REIMPLEMENTED in 2 lines of code:  lavf: if id3v2 tag is present and all else fails, guess by file extension

Conflicts:
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-07 03:32:26 +02:00
Brad
1f6265e011 Fix parser: mark av_parser_parse() for removal on next major bump
Fix the breakage introduced with 9073ca6c6e
2011-04-06 23:45:34 +02:00
Michael Niedermayer
326dff7d05 Fix ticket34
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-06 23:21:44 +02:00
Michael Niedermayer
11d78415ca Merge remote branch 'qatar/master'
* qatar/master:
  psymodel: extend API to include PE and bit allocation.
  avio: always compile dyn_buf functions
  Remove unnecessary parameter from ff_thread_init() and fix behavior
  Revert "aac_latm_dec: use aac context and aac m4ac"
  configure: tell user if libva is enabled like the rest of external libs.
  Add silence support for AV_SAMPLE_FMT_U8.
  avio: make URL_PROTOCOL_FLAG_NESTED_SCHEME internal
  avio: deprecate av_url_read_seek
  avio: deprecate av_url_read_pause
  ac3enc: NEON optimised extract_exponents

Conflicts:
	libavcodec/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-06 02:59:49 +02:00
Michael Niedermayer
ee6db0de37 Fix ffmpeg-mt fixme in h264.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-06 01:09:04 +02:00
Michael Niedermayer
98fe404a94 Fix REBASE_PICTURE with h.264
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-06 01:09:04 +02:00
Michael Niedermayer
b1eeddf1cc Fix Ticket37
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-06 01:09:04 +02:00
Nathan Caldwell
5371803dd5 psymodel: extend API to include PE and bit allocation.
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2011-04-05 22:21:04 +02:00