Commit Graph

999 Commits

Author SHA1 Message Date
Clément Bœsch 570d63eef3 lavu: add FF_CEIL_RSHIFT and use it in various places. 2013-05-09 16:59:42 +02:00
Paul B Mahol 5c057433cc libswscale: GBRAP input & output and GBRAP16 input support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-05-08 12:48:05 +00:00
Michael Niedermayer fe6a36e768 Merge commit 'e55e8b2c362a60bad66929d83d8c83b0d7f5ffc9'
* commit 'e55e8b2c362a60bad66929d83d8c83b0d7f5ffc9':
  lavc: do not leak frames in avcodec_decode_audio4

Conflicts:
	libavcodec/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-08 13:25:19 +02:00
Luca Barbato e55e8b2c36 lavc: do not leak frames in avcodec_decode_audio4
Notwithstanding the return value the frame should be freed if
is not going to be used.

Reported-by: Matthew Wolenetz <wolenetz@chromium.org>
2013-05-07 14:37:32 +02:00
Matt Wolenetz 004779cc59 avcodec/utils: Fix leak by dereferencing audio frame when side data causes whole frame skip
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-07 01:33:08 +02:00
Michael Niedermayer cdfa1c89b7 avcodec: Set frame.width/height on all exit pathes of ff_get_buffer()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-05 14:23:16 +02:00
Michael Niedermayer 0aa095483d Merge commit '6fee1b90ce3bf4fbdfde7016e0890057c9000487'
* commit '6fee1b90ce3bf4fbdfde7016e0890057c9000487':
  avcodec: Add av_cold attributes to init functions missing them

Conflicts:
	libavcodec/aacpsy.c
	libavcodec/atrac3.c
	libavcodec/dvdsubdec.c
	libavcodec/ffv1.c
	libavcodec/ffv1enc.c
	libavcodec/h261enc.c
	libavcodec/h264_parser.c
	libavcodec/h264dsp.c
	libavcodec/h264pred.c
	libavcodec/libschroedingerenc.c
	libavcodec/libxvid_rc.c
	libavcodec/mpeg12.c
	libavcodec/mpeg12enc.c
	libavcodec/proresdsp.c
	libavcodec/rangecoder.c
	libavcodec/videodsp.c
	libavcodec/x86/proresdsp_init.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-05 11:34:29 +02:00
Diego Biurrun 6fee1b90ce avcodec: Add av_cold attributes to init functions missing them 2013-05-04 21:09:45 +02:00
Michael Niedermayer 2ee29b5fb9 avcodec: move lowres down with the next ABI bump and add accessors
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-03 11:32:04 +02:00
Michael Niedermayer 04fa818779 Merge commit '088f38a4f9f54bb923405c67c9e72d96d90aa284'
* commit '088f38a4f9f54bb923405c67c9e72d96d90aa284':
  avcodec: Drop unnecessary ff_ name prefixes from static functions

Conflicts:
	libavcodec/ass.c
	libavcodec/h264_parser.c
	libavcodec/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-01 18:16:32 +02:00
Michael Niedermayer 52fa2945b5 Merge commit 'e036bb7899d0faca9159206be9bf5552e76e7633'
* commit 'e036bb7899d0faca9159206be9bf5552e76e7633':
  lavc: clear AVBuffers on decoded frames if refcounted_frames is not set
  FATE: add an additional indeo3 test

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-01 10:00:08 +02:00
Diego Biurrun 088f38a4f9 avcodec: Drop unnecessary ff_ name prefixes from static functions 2013-04-30 16:02:02 +02:00
Anton Khirnov e036bb7899 lavc: clear AVBuffers on decoded frames if refcounted_frames is not set
Otherwise some code might mistakenly think it is allowed to unref those
buffers, which would lead to double unref.
2013-04-30 11:15:32 +02:00
Michael Niedermayer 24bb01f038 avcodec_string: Print the used codec if it differs from the codec_id name.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-27 00:49:14 +02:00
Michael Niedermayer 59a3b6b751 avcodec_string: remove the "(hq)" listing
printing "hq" depending on a single video encoding parameter makes
little sense

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-27 00:49:12 +02:00
Nicolas George 70feca926b lavc: check decoded subtitles encoding.
Address trac ticket #2431.
2013-04-24 19:41:27 +02:00
Michael Niedermayer 05b2c998c7 avcodec: Fix lowres handling in buffer allocation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-19 21:49:36 +02:00
Michael Niedermayer a8b05dde0d Merge commit 'a7f46586bf47174b5fa00a905b767b1781ec8b72'
* commit 'a7f46586bf47174b5fa00a905b767b1781ec8b72':
  ff_get_buffer(): allocate the frame for max(coded,display) dimensions

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-19 21:49:29 +02:00
Anton Khirnov a7f46586bf ff_get_buffer(): allocate the frame for max(coded,display) dimensions
Needed e.g. for h264 cropping to work properly.
2013-04-19 09:26:53 +02:00
Clément Bœsch 7b80b3cef0 lavc/utils: merge side data after video encode.
This allows encoders to communicate side data to the muxers.
2013-04-19 02:10:12 +02:00
Paul B Mahol b05d8d4cf4 lavc: avcodec_open2(): pass context to av_log()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-04-16 20:46:34 +00:00
Reimar Döffinger c10d498bfd Add thread-safe wrapper for get_format().
Just like get_buffer, get_format should not be called from a different
thread if thread_safe_callbacks is not set.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2013-04-15 09:04:07 +02:00
Anton Khirnov 9de9b828ef lavc: don't overwrite display dimensions with coded dimensions. 2013-04-10 20:54:27 +02:00
Ronald S. Bultje b93b27edb0 dsputil: Make dsputil selectable
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-04-10 11:04:05 +03:00
Nicolas George 0884d04dc3 lavc: fix recoded subtitles end.
Text subtitles packets are not 0-terminated (and if they are,
it is handled by the recoding process since 0 is a valid
Unicode code point). The terminating 0 would overwrite the
last payload octet.

OTOH, packets must be 0-padded.

Fix a problem reported in trac ticket #2431.
2013-04-07 13:25:24 +02:00
Nicolas George 83affcde51 lavc: use packet duration for subtitles if necessary.
Fix trac ticket #2397.
2013-04-04 14:04:51 +02:00
Nicolas George 464f94b206 lavc: do not init frame with guessed layout.
It is breaking support from files with unknown layout.
2013-04-03 17:44:10 +02:00
Michael Niedermayer 12f203a098 Merge commit 'c24469e812501903a46a06eff9722a82e136e841'
* commit 'c24469e812501903a46a06eff9722a82e136e841':
  utils: add workaround for AVHWAccel in ff_get_buffer compat code
  configure: Remove a stray msmpeg4v1 encoder declaration

Conflicts:
	libavcodec/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-27 11:42:15 +01:00
Janne Grunau c24469e812 utils: add workaround for AVHWAccel in ff_get_buffer compat code
Since c977039e58 plane count for
PIX_FMT_HWACCEL pixel formats is 0 instead of 1. The created dummy
AVBuffers are still bogus since AVFrame does not hold frame data when
AVHWAccels are used.
2013-03-26 19:44:50 +01:00
Michael Niedermayer b19604cc4b Merge commit 'f1e9398621af0bc9d166014e4ce6996bb4f141d0'
* commit 'f1e9398621af0bc9d166014e4ce6996bb4f141d0':
  lavc: Rename avpriv_mpv_find_start_code after moving out from mpegvideo

Conflicts:
	libavcodec/h264_parser.c
	libavcodec/internal.h
	libavcodec/mpeg12.c
	libavcodec/utils.c
	libavformat/mpegtsenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-26 13:44:09 +01:00
Michael Niedermayer 2cdedcbcea Merge commit '75644335b907919057960716508477239c26fed4'
* commit '75644335b907919057960716508477239c26fed4':
  lavc: Move start code finding to utils.c

Conflicts:
	configure
	libavcodec/mpegvideo.c
	libavcodec/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-26 13:22:48 +01:00
Martin Storsjö f1e9398621 lavc: Rename avpriv_mpv_find_start_code after moving out from mpegvideo
Also move the declaration to internal.h, and add restrict qualifiers
to the declaration (as in the implementation).

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-26 09:50:02 +02:00
Martin Storsjö 75644335b9 lavc: Move start code finding to utils.c
This allows dropping the mpegvideo dependency from a number of
components.

This also fixes standalone building of the h264 parser, which
was broken in 64e438697.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-03-26 09:48:12 +02:00
Michael Niedermayer 01df2a13c3 avcodec/utils: initialize pixel buffer pool
This should silence many valgrind warnings about use of uninitialized
data, all the warnings i looked at where false positives having their
uninitialized data not actually used.

The same effect could be achieved by listing all code that touches
the pixel buffer in the valgrind suppression file.
Note, valgrind also fails to trace the origins correctly.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-25 00:43:14 +01:00
Carl Eugen Hoyos ac9b056ddb Do not fail in get_buffer_internal() if pix_fmt planes == 0.
Fixes VDPAU decoding, reported by Ilja Sekler
2013-03-22 01:03:07 +01:00
Clément Bœsch 4331484b8d lavc/utils: fix metadata audio frame memleak in case of non refcounted frames.
The metadata must be set before saving the frame to avci->to_free,
otherwise it will leak.

Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Clément Bœsch <ubitux@gmail.com>
2013-03-21 01:07:51 +01:00
Michael Niedermayer df804041bd Merge commit '6599b087de62a5f9f2a8d61a1952d777d1bff804'
* commit '6599b087de62a5f9f2a8d61a1952d777d1bff804':
  buffersrc: fix a typo.
  lavc, lavfi: fix counting number of planes in AVBufferRef wrappers

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-20 11:30:56 +01:00
Stefano Sabatini 33b0549867 lavc/utils: add VP6F hack for setting correct video size in stream
For some obscure reasons avcodec_set_dimensions() resets the width/height
so that the resulting value set in the stream is equal to the
corresponding coded_width/height, which is not the same as the correct
width/height in case of the H.264 and VP6F codecs.

This adds a codec-specific hack for VP6F which disables the call to
avcodec_set_dimensions() in avcodec_open2(), like it is done with H264. A
proper fix needs to be found yet.

Fix trac ticket #1386.

Based on a patch by Michael Niedermayer.

Trolled-By: Daemon404

See thread:
Subject: [FFmpeg-devel] [PATCH] ffprobe: Stash and use width and height before opening the codec
Date: Fri,  1 Mar 2013 10:41:34 -0500
2013-03-19 23:28:08 +01:00
Michael Niedermayer 2c993fece2 audio_get_buffer: add assert to ensure nb_extended_buf has a safe value
May silence CID991853

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-19 14:33:47 +01:00
Anton Khirnov c977039e58 lavc, lavfi: fix counting number of planes in AVBufferRef wrappers
Number of planes is not always equal to the number of components even
for formats marked with PIX_FMT_PLANAR -- e.g. NV12 has three components
in two planes.
2013-03-19 11:12:17 +01:00
Clément Bœsch 4b35be3251 lavc: fix avpacket memleak with subtitles recoding. 2013-03-18 22:04:29 +01:00
Michael Niedermayer 171bd38eda Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavc,lavfi: fix calculating the plane size in the AVBufferRef wrappers

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-17 12:59:04 +01:00
Anton Khirnov 6552808014 lavc,lavfi: fix calculating the plane size in the AVBufferRef wrappers
It is supposed to be height * linesize, not width * linesize.
Thanks to Hendrik Leppkes for pointing out the bug.
2013-03-17 09:10:04 +01:00
Ronald S. Bultje b76d853697 lavc: make compilation of frame_thread_encoder.o optional.
Only compile if CONFIG_ENCODERS is enabled, i.e. if at least one
encoder is to be compiled. This prevents it from being includes in
a decoder-only build.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-14 15:04:17 +01:00
Michael Niedermayer 905e7eb413 Merge commit 'f099d3d1d5466bd63f4ab36270d169ff9ea613b8'
* commit 'f099d3d1d5466bd63f4ab36270d169ff9ea613b8':
  Add av_log_{ask_for_sample|missing_feature} replacements to libavutil
  ismindex: Check the return value of allocations

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-14 12:15:02 +01:00
Diego Biurrun f099d3d1d5 Add av_log_{ask_for_sample|missing_feature} replacements to libavutil
This allows reporting missing features and requesting samples from
all libraries in a standard way; with a simplified API.
2013-03-13 20:42:06 +01:00
Hendrik Leppkes 84bf1cbef9 avcodec: remove AVCodecContext->metadata
This field was only ever set and freed from avcodec, and not otherwise
used. However, because frames are refcounted now, avcodec cannot make any
assumptions about the lifetime of the frame metadata, which can result in
double-frees or leaked memory.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-13 20:16:48 +01:00
Clément Bœsch 1ec94b0f06 lavc: factorize ff_{thread_,re,}get_buffer error messages.
Coccinelle profile used:

  @@
  expression r, ctx, f, loglevel, str, flags;
  @@

  -if ((r = ff_get_buffer(ctx, f, flags)) < 0) {
  -    av_log(ctx, loglevel, str);
  -    return r;
  -}
  +if ((r = ff_get_buffer(ctx, f, flags)) < 0)
  +    return r;

  @@
  expression r, ctx, f, loglevel, str;
  @@

  -if ((r = ff_reget_buffer(ctx, f)) < 0) {
  -    av_log(ctx, loglevel, str);
  -    return r;
  -}
  +if ((r = ff_reget_buffer(ctx, f)) < 0)
  +    return r;

  @@
  expression r, ctx, f, loglevel, str, flags;
  @@

  -if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0) {
  -    av_log(ctx, loglevel, str);
  -    return r;
  -}
  +if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0)
  +    return r;

...along with some manual patches for the remaining ones.
2013-03-13 19:00:10 +01:00
Michael Niedermayer bb3823d457 Merge commit 'a2816230c5c0a8fc72bc0163b7d21a96b194d87a'
* commit 'a2816230c5c0a8fc72bc0163b7d21a96b194d87a':
  avframe: call release_buffer only if it is set

Conflicts:
	libavcodec/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-13 13:45:50 +01:00
Michael Niedermayer ff3e8564c4 Merge commit 'e3232f34312f8187094c875445683277ed0c209d'
* commit 'e3232f34312f8187094c875445683277ed0c209d':
  svq1: use av_frame_free to free refcounted frame
  lavc: fix get_buffer() compatibility layer for audio.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-13 01:56:41 +01:00