ffmpeg-cvslog
Threads by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
September 2009
- 28 participants
- 408 discussions
Author: michael
Date: Thu Apr 16 06:46:44 2009
New Revision: 18533
Log:
Support broken avc nal encapsulation.
Fixes issue987.
Modified:
trunk/libavcodec/h264.c
Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c Thu Apr 16 04:28:49 2009 (r18532)
+++ trunk/libavcodec/h264.c Thu Apr 16 06:46:44 2009 (r18533)
@@ -7461,6 +7461,7 @@ static int decode_nal_units(H264Context
int buf_index=0;
H264Context *hx; ///< thread context
int context_count = 0;
+ int next_avc= h->is_avc ? 0 : buf_size;
h->max_contexts = avctx->thread_count;
#if 0
@@ -7484,7 +7485,7 @@ static int decode_nal_units(H264Context
int i, nalsize = 0;
int err;
- if(h->is_avc) {
+ if(buf_index >= next_avc) {
if(buf_index >= buf_size) break;
nalsize = 0;
for(i = 0; i < h->nal_length_size; i++)
@@ -7498,6 +7499,7 @@ static int decode_nal_units(H264Context
break;
}
}
+ next_avc= buf_index + nalsize;
} else {
// start code prefix search
for(; buf_index + 3 < buf_size; buf_index++){
@@ -7513,7 +7515,7 @@ static int decode_nal_units(H264Context
hx = h->thread_context[context_count];
- ptr= ff_h264_decode_nal(hx, buf + buf_index, &dst_length, &consumed, h->is_avc ? nalsize : buf_size - buf_index);
+ ptr= ff_h264_decode_nal(hx, buf + buf_index, &dst_length, &consumed, next_avc - buf_index);
if (ptr==NULL || dst_length < 0){
return -1;
}
@@ -7525,13 +7527,12 @@ static int decode_nal_units(H264Context
av_log(h->s.avctx, AV_LOG_DEBUG, "NAL %d at %d/%d length %d\n", hx->nal_unit_type, buf_index, buf_size, dst_length);
}
- if (h->is_avc && (nalsize != consumed)){
+ if (h->is_avc && (nalsize != consumed) && nalsize){
int i, debug_level = AV_LOG_DEBUG;
for (i = consumed; i < nalsize; i++)
if (buf[buf_index+i])
debug_level = AV_LOG_ERROR;
av_log(h->s.avctx, debug_level, "AVC: Consumed only %d bytes instead of %d\n", consumed, nalsize);
- consumed= nalsize;
}
buf_index += consumed;
3
7
Author: michael
Date: Sun Oct 19 03:02:48 2008
New Revision: 15641
Log:
Check for pts==dts on I/P frames in the presence of non low delay decoding and
discard these invalid timestamps.
fixes issue171.
Modified:
trunk/libavformat/utils.c
Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c (original)
+++ trunk/libavformat/utils.c Sun Oct 19 03:02:48 2008
@@ -838,6 +838,14 @@ static void compute_pkt_fields(AVFormatC
pkt->dts -= 1LL<<st->pts_wrap_bits;
}
+ // some mpeg2 in mpeg-ps lack dts (issue171 / input_file.mpg)
+ // we take the conservative approach and discard both
+ // Note, if this is misbehaving for a H.264 file then possibly presentation_delayed is not set correctly.
+ if(delay==1 && pkt->dts == pkt->pts && pkt->dts != AV_NOPTS_VALUE && presentation_delayed){
+ av_log(s, AV_LOG_ERROR, "invalid dts/pts combination\n");
+ pkt->dts= pkt->pts= AV_NOPTS_VALUE;
+ }
+
if (pkt->duration == 0) {
compute_frame_duration(&num, &den, st, pc, pkt);
if (den && num) {
2
1
Author: mru
Date: Sat Aug 8 20:27:27 2009
New Revision: 19609
Log:
Generate dependencies while compiling if supported by compiler
Modified:
trunk/common.mak
trunk/configure
Modified: trunk/common.mak
==============================================================================
--- trunk/common.mak Sat Aug 8 20:27:22 2009 (r19608)
+++ trunk/common.mak Sat Aug 8 20:27:27 2009 (r19609)
@@ -21,12 +21,12 @@ ALLFFLIBS = avcodec avdevice avfilter av
CPPFLAGS := -DHAVE_AV_CONFIG_H -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(CPPFLAGS)
%.o: %.c
- $(DEPEND_CMD)
- $(CC) $(CPPFLAGS) $(CFLAGS) $(LIBOBJFLAGS) -c $(CC_O) $<
+ $(CCDEP)
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) $(LIBOBJFLAGS) -c $(CC_O) $<
%.o: %.S
- $(DEPEND_CMD)
- $(AS) $(CPPFLAGS) $(ASFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
+ $(ASDEP)
+ $(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
%.ho: %.h
$(CC) $(CPPFLAGS) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $<
Modified: trunk/configure
==============================================================================
--- trunk/configure Sat Aug 8 20:27:22 2009 (r19608)
+++ trunk/configure Sat Aug 8 20:27:27 2009 (r19609)
@@ -1510,8 +1510,12 @@ filter_asflags=echo
if $cc --version 2>/dev/null | grep -qi gcc; then
cc_type=gcc
+ CC_DEPFLAGS='-MMD'
+ AS_DEPFLAGS='-MMD'
elif $cc --version 2>/dev/null | grep -q Intel; then
cc_type=icc
+ CC_DEPFLAGS='-MMD'
+ AS_DEPFLAGS='-MMD'
elif $cc -v 2>&1 | grep -q xlc; then
cc_type=xlc
elif $cc -V 2>/dev/null | grep -q Compaq; then
@@ -1530,17 +1534,19 @@ elif $cc --vsn 2>/dev/null | grep -q RVC
die "Error creating armcc configuration file."
cc="$cc --arm_linux_config_file=$armcc_conf --translate_gcc"
as_default="${cross_prefix}gcc"
+ CC_DEPFLAGS='-MMD'
+ AS_DEPFLAGS='-MMD'
elif $cc -version 2>/dev/null | grep -q TMS470; then
cc_type=tms470
cc="$cc --gcc --abi=eabi -eo=.o -mc -me"
CC_O='-fr=$(@D)'
as_default="${cross_prefix}gcc"
ld_default="${cross_prefix}gcc"
- dep_cc_default="${cross_prefix}gcc"
TMPO=$(basename $TMPC .c).o
append TMPFILES $TMPO
add_cflags -D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__=
- DEPFLAGS='$(CPPFLAGS) -MM'
+ CC_DEPFLAGS='-ppa -ppd=$(@:.o=.d)'
+ AS_DEPFLAGS='-MMD'
filter_cflags=tms470_flags
tms470_flags(){
for flag; do
@@ -1574,6 +1580,9 @@ test -n "$cc_type" && enable $cc_type ||
: ${ld_default:=$cc}
set_default as dep_cc ld
+test -n "$CC_DEPFLAGS" || CCDEP=$DEPEND_CMD
+test -n "$AS_DEPFLAGS" || ASDEP=$DEPEND_CMD
+
add_cflags $extra_cflags
add_asflags $extra_cflags
@@ -2611,8 +2620,11 @@ echo "SLIBPREF=$SLIBPREF" >> config.mak
echo "SLIBSUF=$SLIBSUF" >> config.mak
echo "EXESUF=$EXESUF" >> config.mak
echo "EXTRA_VERSION=$extra_version" >> config.mak
-echo "DEPEND_CMD=$DEPEND_CMD" >> config.mak
echo "DEPFLAGS=$DEPFLAGS" >> config.mak
+echo "CCDEP=$CCDEP" >> config.mak
+echo "ASDEP=$ASDEP" >> config.mak
+echo "CC_DEPFLAGS=$CC_DEPFLAGS" >> config.mak
+echo "AS_DEPFLAGS=$AS_DEPFLAGS" >> config.mak
echo "HOSTCC=$host_cc" >> config.mak
echo "HOSTCFLAGS=$host_cflags" >> config.mak
echo "HOSTEXESUF=$HOSTEXESUF" >> config.mak
5
4
r18351 - in trunk/libavcodec: 4xm.c 8bps.c 8svx.c aac.c aasc.c ac3dec.c adpcm.c adxdec.c alac.c apedec.c asv1.c atrac3.c avcodec.h avs.c bethsoftvideo.c bfi.c bmp.c c93.c cavsdec.c cinepak.c cljr.c...
by subversion@mplayerhq.hu 14 Jul '10
by subversion@mplayerhq.hu 14 Jul '10
14 Jul '10
Author: rbultje
Date: Tue Apr 7 17:59:50 2009
New Revision: 18351
Log:
Implement avcodec_decode_video2(), _audio3() and _subtitle2() which takes an
AVPacket argument rather than a const uint8_t *buf + int buf_size. This allows
passing of packet-specific flags from demuxer to decoder, such as the keyframe
flag, which appears necessary to playback corePNG P-frames.
Patch by Thilo Borgmann thilo.borgmann googlemail com, see also the thread
"Google Summer of Code participation" on the mailinglist.
Modified:
trunk/libavcodec/4xm.c
trunk/libavcodec/8bps.c
trunk/libavcodec/8svx.c
trunk/libavcodec/aac.c
trunk/libavcodec/aasc.c
trunk/libavcodec/ac3dec.c
trunk/libavcodec/adpcm.c
trunk/libavcodec/adxdec.c
trunk/libavcodec/alac.c
trunk/libavcodec/apedec.c
trunk/libavcodec/asv1.c
trunk/libavcodec/atrac3.c
trunk/libavcodec/avcodec.h
trunk/libavcodec/avs.c
trunk/libavcodec/bethsoftvideo.c
trunk/libavcodec/bfi.c
trunk/libavcodec/bmp.c
trunk/libavcodec/c93.c
trunk/libavcodec/cavsdec.c
trunk/libavcodec/cinepak.c
trunk/libavcodec/cljr.c
trunk/libavcodec/cook.c
trunk/libavcodec/cscd.c
trunk/libavcodec/cyuv.c
trunk/libavcodec/dca.c
trunk/libavcodec/dnxhddec.c
trunk/libavcodec/dpcm.c
trunk/libavcodec/dsicinav.c
trunk/libavcodec/dv.c
trunk/libavcodec/dvbsubdec.c
trunk/libavcodec/dvdsubdec.c
trunk/libavcodec/dxa.c
trunk/libavcodec/eacmv.c
trunk/libavcodec/eatgq.c
trunk/libavcodec/eatgv.c
trunk/libavcodec/eatqi.c
trunk/libavcodec/escape124.c
trunk/libavcodec/ffv1.c
trunk/libavcodec/flacdec.c
trunk/libavcodec/flashsv.c
trunk/libavcodec/flicvideo.c
trunk/libavcodec/fraps.c
trunk/libavcodec/g726.c
trunk/libavcodec/gifdec.c
trunk/libavcodec/h261dec.c
trunk/libavcodec/h263dec.c
trunk/libavcodec/h264.c
trunk/libavcodec/huffyuv.c
trunk/libavcodec/idcinvideo.c
trunk/libavcodec/imc.c
trunk/libavcodec/indeo2.c
trunk/libavcodec/indeo3.c
trunk/libavcodec/interplayvideo.c
trunk/libavcodec/kmvc.c
trunk/libavcodec/lcldec.c
trunk/libavcodec/libamr.c
trunk/libavcodec/libdiracdec.c
trunk/libavcodec/libfaad.c
trunk/libavcodec/libgsm.c
trunk/libavcodec/libopenjpeg.c
trunk/libavcodec/libschroedingerdec.c
trunk/libavcodec/libspeexdec.c
trunk/libavcodec/loco.c
trunk/libavcodec/mace.c
trunk/libavcodec/mdec.c
trunk/libavcodec/mimic.c
trunk/libavcodec/mjpegbdec.c
trunk/libavcodec/mjpegdec.c
trunk/libavcodec/mjpegdec.h
trunk/libavcodec/mlpdec.c
trunk/libavcodec/mmvideo.c
trunk/libavcodec/motionpixels.c
trunk/libavcodec/mpc7.c
trunk/libavcodec/mpc8.c
trunk/libavcodec/mpeg12.c
trunk/libavcodec/mpegaudiodec.c
trunk/libavcodec/mpegvideo.h
trunk/libavcodec/msrle.c
trunk/libavcodec/msvideo1.c
trunk/libavcodec/nellymoserdec.c
trunk/libavcodec/nuv.c
trunk/libavcodec/pcm.c
trunk/libavcodec/pcx.c
trunk/libavcodec/pngdec.c
trunk/libavcodec/pnmenc.c
trunk/libavcodec/ptx.c
trunk/libavcodec/qcelpdec.c
trunk/libavcodec/qdm2.c
trunk/libavcodec/qdrw.c
trunk/libavcodec/qpeg.c
trunk/libavcodec/qtrle.c
trunk/libavcodec/ra144.c
trunk/libavcodec/ra288.c
trunk/libavcodec/rawdec.c
trunk/libavcodec/rl2.c
trunk/libavcodec/roqvideodec.c
trunk/libavcodec/rpza.c
trunk/libavcodec/rv10.c
trunk/libavcodec/rv34.c
trunk/libavcodec/rv34.h
trunk/libavcodec/sgidec.c
trunk/libavcodec/shorten.c
trunk/libavcodec/smacker.c
trunk/libavcodec/smc.c
trunk/libavcodec/snow.c
trunk/libavcodec/sonic.c
trunk/libavcodec/sp5xdec.c
trunk/libavcodec/sunrast.c
trunk/libavcodec/svq1dec.c
trunk/libavcodec/svq3.c
trunk/libavcodec/targa.c
trunk/libavcodec/tiertexseqv.c
trunk/libavcodec/tiff.c
trunk/libavcodec/truemotion1.c
trunk/libavcodec/truemotion2.c
trunk/libavcodec/truespeech.c
trunk/libavcodec/tscc.c
trunk/libavcodec/tta.c
trunk/libavcodec/txd.c
trunk/libavcodec/ulti.c
trunk/libavcodec/utils.c
trunk/libavcodec/vb.c
trunk/libavcodec/vc1.c
trunk/libavcodec/vcr1.c
trunk/libavcodec/vmdav.c
trunk/libavcodec/vmnc.c
trunk/libavcodec/vorbis_dec.c
trunk/libavcodec/vp3.c
trunk/libavcodec/vqavideo.c
trunk/libavcodec/wavpack.c
trunk/libavcodec/wmadec.c
trunk/libavcodec/wnv1.c
trunk/libavcodec/ws-snd1.c
trunk/libavcodec/xan.c
trunk/libavcodec/xl.c
trunk/libavcodec/xsubdec.c
trunk/libavcodec/zmbv.c
Modified: trunk/libavcodec/4xm.c
==============================================================================
--- trunk/libavcodec/4xm.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/4xm.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -677,8 +677,10 @@ static int decode_i_frame(FourXContext *
static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
FourXContext * const f = avctx->priv_data;
AVFrame *picture = data;
AVFrame *p, temp;
Modified: trunk/libavcodec/8bps.c
==============================================================================
--- trunk/libavcodec/8bps.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/8bps.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -58,8 +58,10 @@ typedef struct EightBpsContext {
* Decode a frame
*
*/
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
+static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
EightBpsContext * const c = avctx->priv_data;
const unsigned char *encoded = buf;
unsigned char *pixptr, *pixptr_end;
Modified: trunk/libavcodec/8svx.c
==============================================================================
--- trunk/libavcodec/8svx.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/8svx.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -42,8 +42,10 @@ static const int16_t exponential[16] = {
/** decode a frame */
static int eightsvx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
EightSvxContext *esc = avctx->priv_data;
int16_t *out_data = data;
int consumed = buf_size;
Modified: trunk/libavcodec/aac.c
==============================================================================
--- trunk/libavcodec/aac.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/aac.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -1604,7 +1604,9 @@ static int parse_adts_frame_header(AACCo
return size;
}
-static int aac_decode_frame(AVCodecContext * avccontext, void * data, int * data_size, const uint8_t * buf, int buf_size) {
+static int aac_decode_frame(AVCodecContext * avccontext, void * data, int * data_size, AVPacket *avpkt) {
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
AACContext * ac = avccontext->priv_data;
ChannelElement * che = NULL;
GetBitContext gb;
Modified: trunk/libavcodec/aasc.c
==============================================================================
--- trunk/libavcodec/aasc.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/aasc.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -59,8 +59,10 @@ static av_cold int aasc_decode_init(AVCo
static int aasc_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
AascContext *s = avctx->priv_data;
int compr, i, stride;
Modified: trunk/libavcodec/ac3dec.c
==============================================================================
--- trunk/libavcodec/ac3dec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/ac3dec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -1226,8 +1226,10 @@ static int decode_audio_block(AC3DecodeC
* Decode a single AC-3 frame.
*/
static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
AC3DecodeContext *s = avctx->priv_data;
int16_t *out_samples = (int16_t *)data;
int blk, ch, err;
Modified: trunk/libavcodec/adpcm.c
==============================================================================
--- trunk/libavcodec/adpcm.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/adpcm.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -877,8 +877,10 @@ static void xa_decode(short *out, const
static int adpcm_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
ADPCMContext *c = avctx->priv_data;
ADPCMChannelStatus *cs;
int n, m, channel, i;
Modified: trunk/libavcodec/adxdec.c
==============================================================================
--- trunk/libavcodec/adxdec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/adxdec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -104,8 +104,10 @@ static int adx_decode_header(AVCodecCont
static int adx_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf0, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf0 = avpkt->data;
+ int buf_size = avpkt->size;
ADXContext *c = avctx->priv_data;
short *samples = data;
const uint8_t *buf = buf0;
Modified: trunk/libavcodec/alac.c
==============================================================================
--- trunk/libavcodec/alac.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/alac.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -400,8 +400,10 @@ static void reconstruct_stereo_16(int32_
static int alac_decode_frame(AVCodecContext *avctx,
void *outbuffer, int *outputsize,
- const uint8_t *inbuffer, int input_buffer_size)
+ AVPacket *avpkt)
{
+ const uint8_t *inbuffer = avpkt->data;
+ int input_buffer_size = avpkt->size;
ALACContext *alac = avctx->priv_data;
int channels;
Modified: trunk/libavcodec/apedec.c
==============================================================================
--- trunk/libavcodec/apedec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/apedec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -806,8 +806,10 @@ static void ape_unpack_stereo(APEContext
static int ape_decode_frame(AVCodecContext * avctx,
void *data, int *data_size,
- const uint8_t * buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
APEContext *s = avctx->priv_data;
int16_t *samples = data;
int nblocks;
Modified: trunk/libavcodec/asv1.c
==============================================================================
--- trunk/libavcodec/asv1.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/asv1.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -387,8 +387,10 @@ static inline void dct_get(ASV1Context *
static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
ASV1Context * const a = avctx->priv_data;
AVFrame *picture = data;
AVFrame * const p= (AVFrame*)&a->picture;
Modified: trunk/libavcodec/atrac3.c
==============================================================================
--- trunk/libavcodec/atrac3.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/atrac3.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -878,7 +878,9 @@ static int decodeFrame(ATRAC3Context *q,
static int atrac3_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size) {
+ AVPacket *avpkt) {
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
ATRAC3Context *q = avctx->priv_data;
int result = 0, i;
const uint8_t* databuf;
Modified: trunk/libavcodec/avcodec.h
==============================================================================
--- trunk/libavcodec/avcodec.h Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/avcodec.h Tue Apr 7 17:59:50 2009 (r18351)
@@ -2429,8 +2429,7 @@ typedef struct AVCodec {
int (*init)(AVCodecContext *);
int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data);
int (*close)(AVCodecContext *);
- int (*decode)(AVCodecContext *, void *outdata, int *outdata_size,
- const uint8_t *buf, int buf_size);
+ int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
/**
* Codec capabilities.
* see CODEC_CAP_*
@@ -3020,26 +3019,45 @@ int avcodec_default_execute(AVCodecConte
*/
int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
+#if LIBAVCODEC_VERSION_MAJOR < 53
/**
* Decodes an audio frame from \p buf into \p samples.
- * The avcodec_decode_audio2() function decodes an audio frame from the input
- * buffer \p buf of size \p buf_size. To decode it, it makes use of the
+ * Wrapper function which calls avcodec_decode_audio3.
+ *
+ * @deprecated Use avcodec_decode_audio3 instead.
+ * @param avctx the codec context
+ * @param[out] samples the output buffer
+ * @param[in,out] frame_size_ptr the output buffer size in bytes
+ * @param[in] buf the input buffer
+ * @param[in] buf_size the input buffer size in bytes
+ * @return On error a negative value is returned, otherwise the number of bytes
+ * used or zero if no frame could be decompressed.
+ */
+attribute_deprecated int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
+ int *frame_size_ptr,
+ const uint8_t *buf, int buf_size);
+#endif
+
+/**
+ * Decodes an audio frame from \p avpkt->data into \p samples.
+ * The avcodec_decode_audio3() function decodes an audio frame from the input
+ * buffer \p avpkt->data of size \p avpkt->size. To decode it, it makes use of the
* audio codec which was coupled with \p avctx using avcodec_open(). The
* resulting decoded frame is stored in output buffer \p samples. If no frame
* could be decompressed, \p frame_size_ptr is zero. Otherwise, it is the
* decompressed frame size in \e bytes.
*
* @warning You \e must set \p frame_size_ptr to the allocated size of the
- * output buffer before calling avcodec_decode_audio2().
+ * output buffer before calling avcodec_decode_audio3().
*
* @warning The input buffer must be \c FF_INPUT_BUFFER_PADDING_SIZE larger than
* the actual read bytes because some optimized bitstream readers read 32 or 64
* bits at once and could read over the end.
*
- * @warning The end of the input buffer \p buf should be set to 0 to ensure that
+ * @warning The end of the input buffer \p avpkt->data should be set to 0 to ensure that
* no overreading happens for damaged MPEG streams.
*
- * @note You might have to align the input buffer \p buf and output buffer \p
+ * @note You might have to align the input buffer \p avpkt->data and output buffer \p
* samples. The alignment requirements depend on the CPU: On some CPUs it isn't
* necessary at all, on others it won't work at all if not aligned and on others
* it will work but it will have an impact on performance. In practice, the
@@ -3051,19 +3069,37 @@ int avcodec_open(AVCodecContext *avctx,
* @param avctx the codec context
* @param[out] samples the output buffer
* @param[in,out] frame_size_ptr the output buffer size in bytes
- * @param[in] buf the input buffer
- * @param[in] buf_size the input buffer size in bytes
+ * @param[in] avpkt The input AVPacket containing the input buffer.
* @return On error a negative value is returned, otherwise the number of bytes
* used or zero if no frame could be decompressed.
*/
-int avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
+int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
int *frame_size_ptr,
- const uint8_t *buf, int buf_size);
+ AVPacket *avpkt);
+#if LIBAVCODEC_VERSION_MAJOR < 53
/**
* Decodes a video frame from \p buf into \p picture.
- * The avcodec_decode_video() function decodes a video frame from the input
- * buffer \p buf of size \p buf_size. To decode it, it makes use of the
+ * Wrapper function which calls avcodec_decode_video2.
+ *
+ * @deprecated Use avcodec_decode_video2 instead.
+ * @param avctx the codec context
+ * @param[out] picture The AVFrame in which the decoded video frame will be stored.
+ * @param[in] buf the input buffer
+ * @param[in] buf_size the size of the input buffer in bytes
+ * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero.
+ * @return On error a negative value is returned, otherwise the number of bytes
+ * used or zero if no frame could be decompressed.
+ */
+attribute_deprecated int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
+ int *got_picture_ptr,
+ const uint8_t *buf, int buf_size);
+#endif
+
+/**
+ * Decodes a video frame from \p avpkt->data into \p picture.
+ * The avcodec_decode_video2() function decodes a video frame from the input
+ * buffer \p avpkt->data of size \p avpkt->size. To decode it, it makes use of the
* video codec which was coupled with \p avctx using avcodec_open(). The
* resulting decoded frame is stored in \p picture.
*
@@ -3074,7 +3110,7 @@ int avcodec_decode_audio2(AVCodecContext
* @warning The end of the input buffer \p buf should be set to 0 to ensure that
* no overreading happens for damaged MPEG streams.
*
- * @note You might have to align the input buffer \p buf and output buffer \p
+ * @note You might have to align the input buffer \p avpkt->data and output buffer \p
* samples. The alignment requirements depend on the CPU: on some CPUs it isn't
* necessary at all, on others it won't work at all if not aligned and on others
* it will work but it will have an impact on performance. In practice, the
@@ -3084,26 +3120,42 @@ int avcodec_decode_audio2(AVCodecContext
* start of the buffer to 16.
*
* @note Some codecs have a delay between input and output, these need to be
- * feeded with buf=NULL, buf_size=0 at the end to return the remaining frames.
+ * feeded with avpkt->data=NULL, avpkt->size=0 at the end to return the remaining frames.
*
* @param avctx the codec context
* @param[out] picture The AVFrame in which the decoded video frame will be stored.
- * @param[in] buf the input buffer
- * @param[in] buf_size the size of the input buffer in bytes
+ * @param[in] avpkt The input AVpacket containing the input buffer.
* @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero.
* @return On error a negative value is returned, otherwise the number of bytes
* used or zero if no frame could be decompressed.
*/
-int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
+int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
int *got_picture_ptr,
- const uint8_t *buf, int buf_size);
+ AVPacket *avpkt);
+#if LIBAVCODEC_VERSION_MAJOR < 53
/* Decode a subtitle message. Return -1 if error, otherwise return the
* number of bytes used. If no subtitle could be decompressed,
* got_sub_ptr is zero. Otherwise, the subtitle is stored in *sub. */
-int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
+attribute_deprecated int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
int *got_sub_ptr,
const uint8_t *buf, int buf_size);
+#endif
+
+/**
+ * Decodes a subtitle message.
+ * Returns -1 if error, otherwise returns the number of bytes used.
+ * If no subtitle could be decompressed, \p got_sub_ptr is zero.
+ * Otherwise, the subtitle is stored in \p *sub.
+ *
+ * @param avctx the codec context
+ * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored.
+ * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero.
+ * @param[in] avpkt The input AVPacket containing the input buffer.
+ */
+int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
+ int *got_sub_ptr,
+ AVPacket *avpkt);
int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,
int *data_size_ptr,
uint8_t *buf, int buf_size);
Modified: trunk/libavcodec/avs.c
==============================================================================
--- trunk/libavcodec/avs.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/avs.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -44,8 +44,10 @@ typedef enum {
static int
avs_decode_frame(AVCodecContext * avctx,
- void *data, int *data_size, const uint8_t * buf, int buf_size)
+ void *data, int *data_size, AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
AvsContext *const avs = avctx->priv_data;
AVFrame *picture = data;
AVFrame *const p = (AVFrame *) & avs->picture;
Modified: trunk/libavcodec/bethsoftvideo.c
==============================================================================
--- trunk/libavcodec/bethsoftvideo.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/bethsoftvideo.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -58,8 +58,10 @@ static void set_palette(AVFrame * frame,
static int bethsoftvid_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
BethsoftvidContext * vid = avctx->priv_data;
char block_type;
uint8_t * dst;
Modified: trunk/libavcodec/bfi.c
==============================================================================
--- trunk/libavcodec/bfi.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/bfi.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -45,9 +45,10 @@ static av_cold int bfi_decode_init(AVCod
}
static int bfi_decode_frame(AVCodecContext * avctx, void *data,
- int *data_size, const uint8_t * buf,
- int buf_size)
+ int *data_size, AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
BFIContext *bfi = avctx->priv_data;
uint8_t *dst = bfi->dst;
uint8_t *src, *dst_offset, colour1, colour2;
Modified: trunk/libavcodec/bmp.c
==============================================================================
--- trunk/libavcodec/bmp.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/bmp.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -35,8 +35,10 @@ static av_cold int bmp_decode_init(AVCod
static int bmp_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
BMPContext *s = avctx->priv_data;
AVFrame *picture = data;
AVFrame *p = &s->picture;
Modified: trunk/libavcodec/c93.c
==============================================================================
--- trunk/libavcodec/c93.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/c93.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -113,8 +113,10 @@ static inline void draw_n_color(uint8_t
}
static int decode_frame(AVCodecContext *avctx, void *data,
- int *data_size, const uint8_t * buf, int buf_size)
+ int *data_size, AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
C93DecoderContext * const c93 = avctx->priv_data;
AVFrame * const newpic = &c93->pictures[c93->currentpic];
AVFrame * const oldpic = &c93->pictures[c93->currentpic^1];
Modified: trunk/libavcodec/cavsdec.c
==============================================================================
--- trunk/libavcodec/cavsdec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/cavsdec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -625,7 +625,9 @@ static void cavs_flush(AVCodecContext *
}
static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size,
- const uint8_t * buf, int buf_size) {
+ AVPacket *avpkt) {
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
AVSContext *h = avctx->priv_data;
MpegEncContext *s = &h->s;
int input_size;
Modified: trunk/libavcodec/cinepak.c
==============================================================================
--- trunk/libavcodec/cinepak.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/cinepak.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -411,8 +411,10 @@ static av_cold int cinepak_decode_init(A
static int cinepak_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
CinepakContext *s = avctx->priv_data;
s->data = buf;
Modified: trunk/libavcodec/cljr.c
==============================================================================
--- trunk/libavcodec/cljr.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/cljr.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -42,8 +42,10 @@ typedef struct CLJRContext{
static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
CLJRContext * const a = avctx->priv_data;
AVFrame *picture = data;
AVFrame * const p= (AVFrame*)&a->picture;
Modified: trunk/libavcodec/cook.c
==============================================================================
--- trunk/libavcodec/cook.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/cook.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -979,7 +979,9 @@ static int decode_subpacket(COOKContext
static int cook_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size) {
+ AVPacket *avpkt) {
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
COOKContext *q = avctx->priv_data;
if (buf_size < avctx->block_align)
Modified: trunk/libavcodec/cscd.c
==============================================================================
--- trunk/libavcodec/cscd.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/cscd.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -135,7 +135,9 @@ static void add_frame_32(AVFrame *f, con
#endif
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
- const uint8_t *buf, int buf_size) {
+ AVPacket *avpkt) {
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
CamStudioContext *c = avctx->priv_data;
AVFrame *picture = data;
Modified: trunk/libavcodec/cyuv.c
==============================================================================
--- trunk/libavcodec/cyuv.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/cyuv.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -60,8 +60,10 @@ static av_cold int cyuv_decode_init(AVCo
static int cyuv_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
CyuvDecodeContext *s=avctx->priv_data;
unsigned char *y_plane;
Modified: trunk/libavcodec/dca.c
==============================================================================
--- trunk/libavcodec/dca.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/dca.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -1209,8 +1209,10 @@ static int dca_convert_bitstream(const u
*/
static int dca_decode_frame(AVCodecContext * avctx,
void *data, int *data_size,
- const uint8_t * buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
int i;
int16_t *samples = data;
Modified: trunk/libavcodec/dnxhddec.c
==============================================================================
--- trunk/libavcodec/dnxhddec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/dnxhddec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -278,8 +278,10 @@ static int dnxhd_decode_macroblocks(DNXH
}
static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
DNXHDContext *ctx = avctx->priv_data;
AVFrame *picture = data;
int first_field = 1;
Modified: trunk/libavcodec/dpcm.c
==============================================================================
--- trunk/libavcodec/dpcm.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/dpcm.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -161,8 +161,10 @@ static av_cold int dpcm_decode_init(AVCo
static int dpcm_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
DPCMContext *s = avctx->priv_data;
int in, out = 0;
int predictor[2];
Modified: trunk/libavcodec/dsicinav.c
==============================================================================
--- trunk/libavcodec/dsicinav.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/dsicinav.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -195,8 +195,10 @@ static void cin_decode_rle(const unsigne
static int cinvideo_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
CinVideoContext *cin = avctx->priv_data;
int i, y, palette_type, palette_colors_count, bitmap_frame_type, bitmap_frame_size;
@@ -312,8 +314,10 @@ static av_cold int cinaudio_decode_init(
static int cinaudio_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
CinAudioContext *cin = avctx->priv_data;
const uint8_t *src = buf;
int16_t *samples = (int16_t *)data;
Modified: trunk/libavcodec/dv.c
==============================================================================
--- trunk/libavcodec/dv.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/dv.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -1111,8 +1111,10 @@ static int dv_encode_video_segment(AVCod
144000 bytes for PAL - or twice those for 50Mbps) */
static int dvvideo_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
DVVideoContext *s = avctx->priv_data;
s->sys = dv_frame_profile(buf);
Modified: trunk/libavcodec/dvbsubdec.c
==============================================================================
--- trunk/libavcodec/dvbsubdec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/dvbsubdec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -1345,8 +1345,10 @@ static int dvbsub_display_end_segment(AV
static int dvbsub_decode(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
AVSubtitle *sub = (AVSubtitle*) data;
const uint8_t *p, *p_end;
Modified: trunk/libavcodec/dvdsubdec.c
==============================================================================
--- trunk/libavcodec/dvdsubdec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/dvdsubdec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -475,8 +475,10 @@ static void ppm_save(const char *filenam
static int dvdsub_decode(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
AVSubtitle *sub = (void *)data;
int is_menu;
Modified: trunk/libavcodec/dxa.c
==============================================================================
--- trunk/libavcodec/dxa.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/dxa.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -188,8 +188,10 @@ static int decode_13(AVCodecContext *avc
return 0;
}
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
+static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
DxaDecContext * const c = avctx->priv_data;
uint8_t *outptr, *srcptr, *tmpptr;
unsigned long dsize;
Modified: trunk/libavcodec/eacmv.c
==============================================================================
--- trunk/libavcodec/eacmv.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/eacmv.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -144,8 +144,10 @@ static void cmv_process_header(CmvContex
static int cmv_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
CmvContext *s = avctx->priv_data;
const uint8_t *buf_end = buf + buf_size;
Modified: trunk/libavcodec/eatgq.c
==============================================================================
--- trunk/libavcodec/eatgq.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/eatgq.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -190,7 +190,9 @@ static void tgq_calculate_qtable(TgqCont
static int tgq_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size){
+ AVPacket *avpkt){
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
const uint8_t *buf_start = buf;
const uint8_t *buf_end = buf + buf_size;
TgqContext *s = avctx->priv_data;
Modified: trunk/libavcodec/eatgv.c
==============================================================================
--- trunk/libavcodec/eatgv.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/eatgv.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -237,8 +237,10 @@ static void cond_release_buffer(AVFrame
static int tgv_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
TgvContext *s = avctx->priv_data;
const uint8_t *buf_end = buf + buf_size;
int chunk_type;
Modified: trunk/libavcodec/eatqi.c
==============================================================================
--- trunk/libavcodec/eatqi.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/eatqi.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -101,8 +101,10 @@ static void tqi_calculate_qtable(MpegEnc
static int tqi_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
const uint8_t *buf_end = buf+buf_size;
TqiContext *t = avctx->priv_data;
MpegEncContext *s = &t->s;
Modified: trunk/libavcodec/escape124.c
==============================================================================
--- trunk/libavcodec/escape124.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/escape124.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -206,8 +206,10 @@ static const uint16_t mask_matrix[] = {0
*/
static int escape124_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
Escape124Context *s = avctx->priv_data;
GetBitContext gb;
Modified: trunk/libavcodec/ffv1.c
==============================================================================
--- trunk/libavcodec/ffv1.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/ffv1.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -936,7 +936,9 @@ static av_cold int decode_init(AVCodecCo
return 0;
}
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size){
+static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt){
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
FFV1Context *f = avctx->priv_data;
RangeCoder * const c= &f->c;
const int width= f->width;
Modified: trunk/libavcodec/flacdec.c
==============================================================================
--- trunk/libavcodec/flacdec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/flacdec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -636,8 +636,10 @@ static int decode_frame(FLACContext *s)
static int flac_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
FLACContext *s = avctx->priv_data;
int i, j = 0, input_buf_size = 0, bytes_read = 0;
int16_t *samples_16 = data;
Modified: trunk/libavcodec/flashsv.c
==============================================================================
--- trunk/libavcodec/flashsv.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/flashsv.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -102,8 +102,10 @@ static av_cold int flashsv_decode_init(A
static int flashsv_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
FlashSVContext *s = avctx->priv_data;
int h_blocks, v_blocks, h_part, v_part, i, j;
GetBitContext gb;
Modified: trunk/libavcodec/flicvideo.c
==============================================================================
--- trunk/libavcodec/flicvideo.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/flicvideo.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -701,8 +701,10 @@ static int flic_decode_frame_24BPP(AVCod
static int flic_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
if (avctx->pix_fmt == PIX_FMT_PAL8) {
return flic_decode_frame_8BPP(avctx, data, data_size,
buf, buf_size);
Modified: trunk/libavcodec/fraps.c
==============================================================================
--- trunk/libavcodec/fraps.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/fraps.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -130,8 +130,10 @@ static int fraps2_decode_plane(FrapsCont
*/
static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
FrapsContext * const s = avctx->priv_data;
AVFrame *frame = data;
AVFrame * const f = (AVFrame*)&s->frame;
Modified: trunk/libavcodec/g726.c
==============================================================================
--- trunk/libavcodec/g726.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/g726.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -363,8 +363,10 @@ static int g726_encode_frame(AVCodecCont
static int g726_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
G726Context *c = avctx->priv_data;
short *samples = data;
GetBitContext gb;
Modified: trunk/libavcodec/gifdec.c
==============================================================================
--- trunk/libavcodec/gifdec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/gifdec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -282,8 +282,10 @@ static av_cold int gif_decode_init(AVCod
return 0;
}
-static int gif_decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
+static int gif_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
GifState *s = avctx->priv_data;
AVFrame *picture = data;
int ret;
Modified: trunk/libavcodec/h261dec.c
==============================================================================
--- trunk/libavcodec/h261dec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/h261dec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -543,8 +543,10 @@ static int get_consumed_bytes(MpegEncCon
static int h261_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
H261Context *h= avctx->priv_data;
MpegEncContext *s = &h->s;
int ret;
Modified: trunk/libavcodec/h263dec.c
==============================================================================
--- trunk/libavcodec/h263dec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/h263dec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -331,8 +331,10 @@ static int decode_slice(MpegEncContext *
int ff_h263_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
MpegEncContext *s = avctx->priv_data;
int ret;
AVFrame *pict = data;
Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/h264.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -7618,8 +7618,10 @@ static int get_consumed_bytes(MpegEncCon
static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
H264Context *h = avctx->priv_data;
MpegEncContext *s = &h->s;
AVFrame *pict = data;
Modified: trunk/libavcodec/huffyuv.c
==============================================================================
--- trunk/libavcodec/huffyuv.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/huffyuv.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -942,7 +942,9 @@ static void draw_slice(HYuvContext *s, i
s->last_slice_end= y + h;
}
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size){
+static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt){
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
HYuvContext *s = avctx->priv_data;
const int width= s->width;
const int width2= s->width>>1;
Modified: trunk/libavcodec/idcinvideo.c
==============================================================================
--- trunk/libavcodec/idcinvideo.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/idcinvideo.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -209,8 +209,10 @@ static void idcin_decode_vlcs(IdcinConte
static int idcin_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
IdcinContext *s = avctx->priv_data;
AVPaletteControl *palette_control = avctx->palctrl;
Modified: trunk/libavcodec/imc.c
==============================================================================
--- trunk/libavcodec/imc.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/imc.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -639,8 +639,10 @@ static int imc_get_coeffs (IMCContext* q
static int imc_decode_frame(AVCodecContext * avctx,
void *data, int *data_size,
- const uint8_t * buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
IMCContext *q = avctx->priv_data;
Modified: trunk/libavcodec/indeo2.c
==============================================================================
--- trunk/libavcodec/indeo2.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/indeo2.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -136,8 +136,10 @@ static int ir2_decode_plane_inter(Ir2Con
static int ir2_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
Ir2Context * const s = avctx->priv_data;
AVFrame *picture = data;
AVFrame * const p= (AVFrame*)&s->picture;
Modified: trunk/libavcodec/indeo3.c
==============================================================================
--- trunk/libavcodec/indeo3.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/indeo3.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -1062,8 +1062,10 @@ static int iv_decode_frame(Indeo3DecodeC
static int indeo3_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
Indeo3DecodeContext *s=avctx->priv_data;
uint8_t *src, *dest;
int y;
Modified: trunk/libavcodec/interplayvideo.c
==============================================================================
--- trunk/libavcodec/interplayvideo.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/interplayvideo.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -639,8 +639,10 @@ static av_cold int ipvideo_decode_init(A
static int ipvideo_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
IpvideoContext *s = avctx->priv_data;
AVPaletteControl *palette_control = avctx->palctrl;
Modified: trunk/libavcodec/kmvc.c
==============================================================================
--- trunk/libavcodec/kmvc.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/kmvc.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -224,9 +224,10 @@ static void kmvc_decode_inter_8x8(KmvcCo
}
}
-static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, const uint8_t * buf,
- int buf_size)
+static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
KmvcContext *const ctx = avctx->priv_data;
uint8_t *out, *src;
int i;
Modified: trunk/libavcodec/lcldec.c
==============================================================================
--- trunk/libavcodec/lcldec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/lcldec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -161,8 +161,10 @@ static unsigned int mszh_decomp(unsigned
* Decode a frame
*
*/
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
+static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
LclDecContext * const c = avctx->priv_data;
unsigned char *encoded = (unsigned char *)buf;
unsigned int pixel_ptr;
Modified: trunk/libavcodec/libamr.c
==============================================================================
--- trunk/libavcodec/libamr.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/libamr.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -245,8 +245,10 @@ static av_cold int amr_nb_decode_close(A
static int amr_nb_decode_frame(AVCodecContext * avctx,
void *data, int *data_size,
- const uint8_t * buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
AMRContext *s = avctx->priv_data;
const uint8_t*amrData=buf;
int offset=0;
@@ -654,8 +656,10 @@ static int amr_wb_decode_init(AVCodecCon
static int amr_wb_decode_frame(AVCodecContext * avctx,
void *data, int *data_size,
- const uint8_t * buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
AMRWBContext *s = avctx->priv_data;
const uint8_t*amrData=buf;
int mode;
Modified: trunk/libavcodec/libdiracdec.c
==============================================================================
--- trunk/libavcodec/libdiracdec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/libdiracdec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -77,8 +77,10 @@ static av_cold int libdirac_decode_init(
static int libdirac_decode_frame(AVCodecContext *avccontext,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
FfmpegDiracDecoderParams *p_dirac_params = avccontext->priv_data;
AVPicture *picture = data;
Modified: trunk/libavcodec/libfaad.c
==============================================================================
--- trunk/libavcodec/libfaad.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/libfaad.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -149,8 +149,10 @@ static av_cold int faac_init_mp4(AVCodec
static int faac_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
FAACContext *s = avctx->priv_data;
#ifndef FAAD2_VERSION
unsigned long bytesconsumed;
Modified: trunk/libavcodec/libgsm.c
==============================================================================
--- trunk/libavcodec/libgsm.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/libgsm.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -138,7 +138,9 @@ AVCodec libgsm_ms_encoder = {
static int libgsm_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- uint8_t *buf, int buf_size) {
+ AVPacket *avpkt) {
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
*data_size = 0; /* In case of error */
if(buf_size < avctx->block_align) return -1;
switch(avctx->codec_id) {
Modified: trunk/libavcodec/libopenjpeg.c
==============================================================================
--- trunk/libavcodec/libopenjpeg.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/libopenjpeg.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -58,8 +58,10 @@ static av_cold int libopenjpeg_decode_in
static int libopenjpeg_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
LibOpenJPEGContext *ctx = avctx->priv_data;
AVFrame *picture = &ctx->image, *output = data;
opj_dinfo_t *dec;
Modified: trunk/libavcodec/libschroedingerdec.c
==============================================================================
--- trunk/libavcodec/libschroedingerdec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/libschroedingerdec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -207,8 +207,10 @@ static void libschroedinger_handle_first
static int libschroedinger_decode_frame(AVCodecContext *avccontext,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
FfmpegSchroDecoderParams *p_schro_params = avccontext->priv_data;
SchroDecoder *decoder = p_schro_params->decoder;
Modified: trunk/libavcodec/libspeexdec.c
==============================================================================
--- trunk/libavcodec/libspeexdec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/libspeexdec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -90,8 +90,10 @@ static av_cold int libspeex_decode_init(
static int libspeex_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
LibSpeexContext *s = avctx->priv_data;
int16_t *output = data, *end;
int i, num_samples;
Modified: trunk/libavcodec/loco.c
==============================================================================
--- trunk/libavcodec/loco.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/loco.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -158,8 +158,10 @@ static int loco_decode_plane(LOCOContext
static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
LOCOContext * const l = avctx->priv_data;
AVFrame * const p= (AVFrame*)&l->pic;
int decoded;
Modified: trunk/libavcodec/mace.c
==============================================================================
--- trunk/libavcodec/mace.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/mace.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -236,8 +236,10 @@ static av_cold int mace_decode_init(AVCo
static int mace_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
int16_t *samples = data;
MACEContext *ctx = avctx->priv_data;
int i, j, k, l;
Modified: trunk/libavcodec/mdec.c
==============================================================================
--- trunk/libavcodec/mdec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/mdec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -154,8 +154,10 @@ static inline void idct_put(MDECContext
static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
MDECContext * const a = avctx->priv_data;
AVFrame *picture = data;
AVFrame * const p= &a->picture;
Modified: trunk/libavcodec/mimic.c
==============================================================================
--- trunk/libavcodec/mimic.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/mimic.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -274,8 +274,10 @@ static void prepare_avpic(MimicContext *
}
static int mimic_decode_frame(AVCodecContext *avctx, void *data,
- int *data_size, const uint8_t *buf, int buf_size)
+ int *data_size, AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
MimicContext *ctx = avctx->priv_data;
int is_pframe;
int width, height;
Modified: trunk/libavcodec/mjpegbdec.c
==============================================================================
--- trunk/libavcodec/mjpegbdec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/mjpegbdec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -31,8 +31,10 @@
static int mjpegb_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
MJpegDecodeContext *s = avctx->priv_data;
const uint8_t *buf_end, *buf_ptr;
AVFrame *picture = data;
Modified: trunk/libavcodec/mjpegdec.c
==============================================================================
--- trunk/libavcodec/mjpegdec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/mjpegdec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -1258,8 +1258,10 @@ found:
int ff_mjpeg_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
MJpegDecodeContext *s = avctx->priv_data;
const uint8_t *buf_end, *buf_ptr;
int start_code;
Modified: trunk/libavcodec/mjpegdec.h
==============================================================================
--- trunk/libavcodec/mjpegdec.h Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/mjpegdec.h Tue Apr 7 17:59:50 2009 (r18351)
@@ -106,7 +106,7 @@ int ff_mjpeg_decode_init(AVCodecContext
int ff_mjpeg_decode_end(AVCodecContext *avctx);
int ff_mjpeg_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size);
+ AVPacket *avpkt);
int ff_mjpeg_decode_dqt(MJpegDecodeContext *s);
int ff_mjpeg_decode_dht(MJpegDecodeContext *s);
int ff_mjpeg_decode_sof(MJpegDecodeContext *s);
Modified: trunk/libavcodec/mlpdec.c
==============================================================================
--- trunk/libavcodec/mlpdec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/mlpdec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -904,8 +904,10 @@ static int output_data(MLPDecodeContext
* otherwise returns the number of bytes consumed. */
static int read_access_unit(AVCodecContext *avctx, void* data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
MLPDecodeContext *m = avctx->priv_data;
GetBitContext gb;
unsigned int length, substr;
Modified: trunk/libavcodec/mmvideo.c
==============================================================================
--- trunk/libavcodec/mmvideo.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/mmvideo.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -159,8 +159,10 @@ static void mm_decode_inter(MmContext *
static int mm_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
MmContext *s = avctx->priv_data;
const uint8_t *buf_end = buf+buf_size;
int type;
Modified: trunk/libavcodec/motionpixels.c
==============================================================================
--- trunk/libavcodec/motionpixels.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/motionpixels.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -281,8 +281,10 @@ static void mp_decode_frame_helper(Motio
static int mp_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
MotionPixelsContext *mp = avctx->priv_data;
GetBitContext gb;
int i, count1, count2, sz;
Modified: trunk/libavcodec/mpc7.c
==============================================================================
--- trunk/libavcodec/mpc7.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/mpc7.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -156,8 +156,10 @@ static inline void idx_to_quant(MPCConte
static int mpc7_decode_frame(AVCodecContext * avctx,
void *data, int *data_size,
- const uint8_t * buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
MPCContext *c = avctx->priv_data;
GetBitContext gb;
uint8_t *bits;
Modified: trunk/libavcodec/mpc8.c
==============================================================================
--- trunk/libavcodec/mpc8.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/mpc8.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -180,8 +180,10 @@ static av_cold int mpc8_decode_init(AVCo
static int mpc8_decode_frame(AVCodecContext * avctx,
void *data, int *data_size,
- const uint8_t * buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
MPCContext *c = avctx->priv_data;
GetBitContext gb2, *gb = &gb2;
int i, j, k, ch, cnt, res, t;
Modified: trunk/libavcodec/mpeg12.c
==============================================================================
--- trunk/libavcodec/mpeg12.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/mpeg12.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -2260,8 +2260,10 @@ static int decode_chunks(AVCodecContext
/* handle buffering and image synchronisation */
static int mpeg_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
Mpeg1Context *s = avctx->priv_data;
AVFrame *picture = data;
MpegEncContext *s2 = &s->mpeg_enc_ctx;
Modified: trunk/libavcodec/mpegaudiodec.c
==============================================================================
--- trunk/libavcodec/mpegaudiodec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/mpegaudiodec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -2258,8 +2258,10 @@ static int mp_decode_frame(MPADecodeCont
static int decode_frame(AVCodecContext * avctx,
void *data, int *data_size,
- const uint8_t * buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
MPADecodeContext *s = avctx->priv_data;
uint32_t header;
int out_size;
@@ -2315,8 +2317,10 @@ static void flush(AVCodecContext *avctx)
#if CONFIG_MP3ADU_DECODER
static int decode_frame_adu(AVCodecContext * avctx,
void *data, int *data_size,
- const uint8_t * buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
MPADecodeContext *s = avctx->priv_data;
uint32_t header;
int len, out_size;
@@ -2459,8 +2463,10 @@ static av_cold int decode_close_mp3on4(A
static int decode_frame_mp3on4(AVCodecContext * avctx,
void *data, int *data_size,
- const uint8_t * buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
MP3On4DecodeContext *s = avctx->priv_data;
MPADecodeContext *m;
int fsize, len = buf_size, out_size = 0;
Modified: trunk/libavcodec/mpegvideo.h
==============================================================================
--- trunk/libavcodec/mpegvideo.h Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/mpegvideo.h Tue Apr 7 17:59:50 2009 (r18351)
@@ -795,7 +795,7 @@ int ff_h261_get_picture_format(int width
int ff_h263_decode_init(AVCodecContext *avctx);
int ff_h263_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size);
+ AVPacket *avpkt);
int ff_h263_decode_end(AVCodecContext *avctx);
void h263_encode_mb(MpegEncContext *s,
DCTELEM block[6][64],
Modified: trunk/libavcodec/msrle.c
==============================================================================
--- trunk/libavcodec/msrle.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/msrle.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -63,8 +63,10 @@ static av_cold int msrle_decode_init(AVC
static int msrle_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
MsrleContext *s = avctx->priv_data;
s->buf = buf;
Modified: trunk/libavcodec/msvideo1.c
==============================================================================
--- trunk/libavcodec/msvideo1.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/msvideo1.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -294,8 +294,10 @@ static void msvideo1_decode_16bit(Msvide
static int msvideo1_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
Msvideo1Context *s = avctx->priv_data;
s->buf = buf;
Modified: trunk/libavcodec/nellymoserdec.c
==============================================================================
--- trunk/libavcodec/nellymoserdec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/nellymoserdec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -153,7 +153,9 @@ static av_cold int decode_init(AVCodecCo
static int decode_tag(AVCodecContext * avctx,
void *data, int *data_size,
- const uint8_t * buf, int buf_size) {
+ AVPacket *avpkt) {
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
NellyMoserDecodeContext *s = avctx->priv_data;
int blocks, i;
int16_t* samples;
Modified: trunk/libavcodec/nuv.c
==============================================================================
--- trunk/libavcodec/nuv.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/nuv.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -128,7 +128,9 @@ static int codec_reinit(AVCodecContext *
}
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
- const uint8_t *buf, int buf_size) {
+ AVPacket *avpkt) {
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
NuvContext *c = avctx->priv_data;
AVFrame *picture = data;
int orig_size = buf_size;
Modified: trunk/libavcodec/pcm.c
==============================================================================
--- trunk/libavcodec/pcm.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/pcm.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -323,8 +323,10 @@ static av_cold int pcm_decode_init(AVCod
static int pcm_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
PCMDecode *s = avctx->priv_data;
int sample_size, c, n;
short *samples;
Modified: trunk/libavcodec/pcx.c
==============================================================================
--- trunk/libavcodec/pcx.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/pcx.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -70,7 +70,9 @@ static void pcx_palette(const uint8_t **
}
static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
- const uint8_t *buf, int buf_size) {
+ AVPacket *avpkt) {
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
PCXContext * const s = avctx->priv_data;
AVFrame *picture = data;
AVFrame * const p = &s->picture;
Modified: trunk/libavcodec/pngdec.c
==============================================================================
--- trunk/libavcodec/pngdec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/pngdec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -379,8 +379,10 @@ static int png_decode_idat(PNGDecContext
static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
PNGDecContext * const s = avctx->priv_data;
AVFrame *picture = data;
AVFrame * const p= &s->picture;
Modified: trunk/libavcodec/pnmenc.c
==============================================================================
--- trunk/libavcodec/pnmenc.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/pnmenc.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -34,8 +34,10 @@ static av_cold int common_init(AVCodecCo
static int pnm_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
PNMContext * const s = avctx->priv_data;
AVFrame *picture = data;
AVFrame * const p= (AVFrame*)&s->picture;
Modified: trunk/libavcodec/ptx.c
==============================================================================
--- trunk/libavcodec/ptx.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/ptx.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -36,7 +36,9 @@ static av_cold int ptx_init(AVCodecConte
}
static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
- const uint8_t *buf, int buf_size) {
+ AVPacket *avpkt) {
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
PTXContext * const s = avctx->priv_data;
AVFrame *picture = data;
AVFrame * const p = &s->picture;
Modified: trunk/libavcodec/qcelpdec.c
==============================================================================
--- trunk/libavcodec/qcelpdec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/qcelpdec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -729,8 +729,10 @@ static void warn_insufficient_frame_qual
}
static int qcelp_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
QCELPContext *q = avctx->priv_data;
float *outbuffer = data;
int i;
Modified: trunk/libavcodec/qdm2.c
==============================================================================
--- trunk/libavcodec/qdm2.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/qdm2.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -1968,8 +1968,10 @@ static void qdm2_decode (QDM2Context *q,
static int qdm2_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
QDM2Context *s = avctx->priv_data;
if(!buf)
Modified: trunk/libavcodec/qdrw.c
==============================================================================
--- trunk/libavcodec/qdrw.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/qdrw.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -34,8 +34,10 @@ typedef struct QdrawContext{
static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
QdrawContext * const a = avctx->priv_data;
AVFrame * const p= (AVFrame*)&a->pic;
uint8_t* outdata;
Modified: trunk/libavcodec/qpeg.c
==============================================================================
--- trunk/libavcodec/qpeg.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/qpeg.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -248,8 +248,10 @@ static void qpeg_decode_inter(const uint
static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
QpegContext * const a = avctx->priv_data;
AVFrame * const p= (AVFrame*)&a->pic;
uint8_t* outdata;
Modified: trunk/libavcodec/qtrle.c
==============================================================================
--- trunk/libavcodec/qtrle.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/qtrle.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -424,8 +424,10 @@ static av_cold int qtrle_decode_init(AVC
static int qtrle_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
QtrleContext *s = avctx->priv_data;
int header, start_line;
int stream_ptr, height, row_ptr;
Modified: trunk/libavcodec/ra144.c
==============================================================================
--- trunk/libavcodec/ra144.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/ra144.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -287,8 +287,10 @@ static int interp(RA144Context *ractx, i
/** Uncompress one block (20 bytes -> 160*2 bytes). */
static int ra144_decode_frame(AVCodecContext * avctx, void *vdata,
- int *data_size, const uint8_t *buf, int buf_size)
+ int *data_size, AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
static const uint8_t sizes[10] = {6, 5, 5, 4, 4, 3, 3, 3, 3, 2};
unsigned int refl_rms[4]; // RMS of the reflection coefficients
uint16_t block_coefs[4][30]; // LPC coefficients of each sub-block
Modified: trunk/libavcodec/ra288.c
==============================================================================
--- trunk/libavcodec/ra288.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/ra288.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -160,9 +160,10 @@ static void backward_filter(float *hist,
}
static int ra288_decode_frame(AVCodecContext * avctx, void *data,
- int *data_size, const uint8_t * buf,
- int buf_size)
+ int *data_size, AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
float *out = data;
int i, j;
RA288Context *ractx = avctx->priv_data;
Modified: trunk/libavcodec/rawdec.c
==============================================================================
--- trunk/libavcodec/rawdec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/rawdec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -100,8 +100,10 @@ static void flip(AVCodecContext *avctx,
static int raw_decode(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
RawVideoContext *context = avctx->priv_data;
AVFrame * frame = (AVFrame *) data;
Modified: trunk/libavcodec/rl2.c
==============================================================================
--- trunk/libavcodec/rl2.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/rl2.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -181,8 +181,10 @@ static av_cold int rl2_decode_init(AVCod
*/
static int rl2_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
Rl2Context *s = avctx->priv_data;
if(s->frame.data[0])
Modified: trunk/libavcodec/roqvideodec.c
==============================================================================
--- trunk/libavcodec/roqvideodec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/roqvideodec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -169,8 +169,10 @@ static av_cold int roq_decode_init(AVCod
static int roq_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
RoqContext *s = avctx->priv_data;
int copy= !s->current_frame->data[0];
Modified: trunk/libavcodec/rpza.c
==============================================================================
--- trunk/libavcodec/rpza.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/rpza.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -241,8 +241,10 @@ static av_cold int rpza_decode_init(AVCo
static int rpza_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
RpzaContext *s = avctx->priv_data;
s->buf = buf;
Modified: trunk/libavcodec/rv10.c
==============================================================================
--- trunk/libavcodec/rv10.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/rv10.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -727,8 +727,10 @@ static int get_slice_offset(AVCodecConte
static int rv10_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
MpegEncContext *s = avctx->priv_data;
int i;
AVFrame *pict = data;
Modified: trunk/libavcodec/rv34.c
==============================================================================
--- trunk/libavcodec/rv34.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/rv34.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -1370,8 +1370,10 @@ static int get_slice_offset(AVCodecConte
int ff_rv34_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
RV34DecContext *r = avctx->priv_data;
MpegEncContext *s = &r->s;
AVFrame *pict = data;
Modified: trunk/libavcodec/rv34.h
==============================================================================
--- trunk/libavcodec/rv34.h Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/rv34.h Tue Apr 7 17:59:50 2009 (r18351)
@@ -123,7 +123,7 @@ typedef struct RV34DecContext{
*/
int ff_rv34_get_start_offset(GetBitContext *gb, int blocks);
int ff_rv34_decode_init(AVCodecContext *avctx);
-int ff_rv34_decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size);
+int ff_rv34_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt);
int ff_rv34_decode_end(AVCodecContext *avctx);
#endif /* AVCODEC_RV34_H */
Modified: trunk/libavcodec/sgidec.c
==============================================================================
--- trunk/libavcodec/sgidec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/sgidec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -147,8 +147,10 @@ static int read_uncompressed_sgi(unsigne
static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *in_buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *in_buf = avpkt->data;
+ int buf_size = avpkt->size;
SgiState *s = avctx->priv_data;
AVFrame *picture = data;
AVFrame *p = &s->picture;
Modified: trunk/libavcodec/shorten.c
==============================================================================
--- trunk/libavcodec/shorten.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/shorten.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -269,8 +269,10 @@ static void decode_subframe_lpc(ShortenC
static int shorten_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
ShortenContext *s = avctx->priv_data;
int i, input_buf_size = 0;
int16_t *samples = data;
Modified: trunk/libavcodec/smacker.c
==============================================================================
--- trunk/libavcodec/smacker.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/smacker.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -345,8 +345,10 @@ static av_always_inline int smk_get_code
return v;
}
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
+static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
SmackVContext * const smk = avctx->priv_data;
uint8_t *out;
uint32_t *pal;
@@ -565,8 +567,10 @@ static av_cold int smka_decode_init(AVCo
/**
* Decode Smacker audio data
*/
-static int smka_decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
+static int smka_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
GetBitContext gb;
HuffContext h[4];
VLC vlc[4];
Modified: trunk/libavcodec/smc.c
==============================================================================
--- trunk/libavcodec/smc.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/smc.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -441,8 +441,10 @@ static av_cold int smc_decode_init(AVCod
static int smc_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
SmcContext *s = avctx->priv_data;
s->buf = buf;
Modified: trunk/libavcodec/snow.c
==============================================================================
--- trunk/libavcodec/snow.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/snow.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -4483,7 +4483,9 @@ static av_cold int decode_init(AVCodecCo
return 0;
}
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size){
+static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt){
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
SnowContext *s = avctx->priv_data;
RangeCoder * const c= &s->c;
int bytes_read;
Modified: trunk/libavcodec/sonic.c
==============================================================================
--- trunk/libavcodec/sonic.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/sonic.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -851,8 +851,10 @@ static av_cold int sonic_decode_close(AV
static int sonic_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
SonicContext *s = avctx->priv_data;
GetBitContext gb;
int i, quant, ch, j;
Modified: trunk/libavcodec/sp5xdec.c
==============================================================================
--- trunk/libavcodec/sp5xdec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/sp5xdec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -32,8 +32,11 @@
static int sp5x_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
+ AVPacket avpkt_recoded;
#if 0
MJpegDecodeContext *s = avctx->priv_data;
#endif
@@ -89,7 +92,10 @@ static int sp5x_decode_frame(AVCodecCont
recoded[j++] = 0xD9;
avctx->flags &= ~CODEC_FLAG_EMU_EDGE;
- i = ff_mjpeg_decode_frame(avctx, data, data_size, recoded, j);
+ av_init_packet(&avpkt_recoded);
+ avpkt_recoded.data = recoded;
+ avpkt_recoded.size = j;
+ i = ff_mjpeg_decode_frame(avctx, data, data_size, &avpkt_recoded);
av_free(recoded);
Modified: trunk/libavcodec/sunrast.c
==============================================================================
--- trunk/libavcodec/sunrast.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/sunrast.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -43,7 +43,9 @@ static av_cold int sunrast_init(AVCodecC
}
static int sunrast_decode_frame(AVCodecContext *avctx, void *data,
- int *data_size, const uint8_t *buf, int buf_size) {
+ int *data_size, AVPacket *avpkt) {
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
SUNRASTContext * const s = avctx->priv_data;
AVFrame *picture = data;
AVFrame * const p = &s->picture;
Modified: trunk/libavcodec/svq1dec.c
==============================================================================
--- trunk/libavcodec/svq1dec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/svq1dec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -642,8 +642,10 @@ static int svq1_decode_frame_header (Get
static int svq1_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
MpegEncContext *s=avctx->priv_data;
uint8_t *current, *previous;
int result, i, x, y, width, height;
Modified: trunk/libavcodec/svq3.c
==============================================================================
--- trunk/libavcodec/svq3.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/svq3.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -889,8 +889,10 @@ static av_cold int svq3_decode_init(AVCo
static int svq3_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
MpegEncContext *const s = avctx->priv_data;
H264Context *const h = avctx->priv_data;
int m, mb_type;
Modified: trunk/libavcodec/targa.c
==============================================================================
--- trunk/libavcodec/targa.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/targa.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -91,8 +91,10 @@ static void targa_decode_rle(AVCodecCont
static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
TargaContext * const s = avctx->priv_data;
AVFrame *picture = data;
AVFrame * const p= (AVFrame*)&s->picture;
Modified: trunk/libavcodec/tiertexseqv.c
==============================================================================
--- trunk/libavcodec/tiertexseqv.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/tiertexseqv.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -187,8 +187,10 @@ static av_cold int seqvideo_decode_init(
static int seqvideo_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
SeqVideoContext *seq = avctx->priv_data;
Modified: trunk/libavcodec/tiff.c
==============================================================================
--- trunk/libavcodec/tiff.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/tiff.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -404,8 +404,10 @@ static int tiff_decode_tag(TiffContext *
static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
TiffContext * const s = avctx->priv_data;
AVFrame *picture = data;
AVFrame * const p= (AVFrame*)&s->picture;
Modified: trunk/libavcodec/truemotion1.c
==============================================================================
--- trunk/libavcodec/truemotion1.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/truemotion1.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -846,8 +846,10 @@ static void truemotion1_decode_24bit(Tru
static int truemotion1_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
TrueMotion1Context *s = avctx->priv_data;
s->buf = buf;
Modified: trunk/libavcodec/truemotion2.c
==============================================================================
--- trunk/libavcodec/truemotion2.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/truemotion2.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -763,8 +763,10 @@ static const int tm2_stream_order[TM2_NU
static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
TM2Context * const l = avctx->priv_data;
AVFrame * const p= (AVFrame*)&l->pic;
int i, skip, t;
Modified: trunk/libavcodec/truespeech.c
==============================================================================
--- trunk/libavcodec/truespeech.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/truespeech.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -332,8 +332,10 @@ static void truespeech_save_prevvec(TSCo
static int truespeech_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
TSContext *c = avctx->priv_data;
int i, j;
Modified: trunk/libavcodec/tscc.c
==============================================================================
--- trunk/libavcodec/tscc.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/tscc.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -67,8 +67,10 @@ typedef struct TsccContext {
* Decode a frame
*
*/
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
+static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
CamtasiaContext * const c = avctx->priv_data;
const unsigned char *encoded = buf;
unsigned char *outptr;
Modified: trunk/libavcodec/tta.c
==============================================================================
--- trunk/libavcodec/tta.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/tta.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -287,8 +287,10 @@ static av_cold int tta_decode_init(AVCod
static int tta_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
TTAContext *s = avctx->priv_data;
int i;
Modified: trunk/libavcodec/txd.c
==============================================================================
--- trunk/libavcodec/txd.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/txd.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -39,7 +39,9 @@ static av_cold int txd_init(AVCodecConte
}
static int txd_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
- const uint8_t *buf, int buf_size) {
+ AVPacket *avpkt) {
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
TXDContext * const s = avctx->priv_data;
AVFrame *picture = data;
AVFrame * const p = &s->picture;
Modified: trunk/libavcodec/ulti.c
==============================================================================
--- trunk/libavcodec/ulti.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/ulti.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -200,8 +200,10 @@ static void ulti_grad(AVFrame *frame, in
static int ulti_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
UltimotionDecodeContext *s=avctx->priv_data;
int modifier = 0;
int uniq = 0;
Modified: trunk/libavcodec/utils.c
==============================================================================
--- trunk/libavcodec/utils.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/utils.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -524,18 +524,32 @@ int avcodec_encode_subtitle(AVCodecConte
return ret;
}
+#if LIBAVCODEC_VERSION_MAJOR < 53
int attribute_align_arg avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
int *got_picture_ptr,
const uint8_t *buf, int buf_size)
{
+ AVPacket avpkt;
+ av_init_packet(&avpkt);
+ avpkt.data = buf;
+ avpkt.size = buf_size;
+
+ return avcodec_decode_video2(avctx, picture, got_picture_ptr, &avpkt);
+}
+#endif
+
+int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
+ int *got_picture_ptr,
+ AVPacket *avpkt)
+{
int ret;
*got_picture_ptr= 0;
if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height))
return -1;
- if((avctx->codec->capabilities & CODEC_CAP_DELAY) || buf_size){
+ if((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size){
ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
- buf, buf_size);
+ avpkt);
emms_c(); //needed to avoid an emms_c() call before every return;
@@ -547,13 +561,27 @@ int attribute_align_arg avcodec_decode_v
return ret;
}
+#if LIBAVCODEC_VERSION_MAJOR < 53
int attribute_align_arg avcodec_decode_audio2(AVCodecContext *avctx, int16_t *samples,
int *frame_size_ptr,
const uint8_t *buf, int buf_size)
{
+ AVPacket avpkt;
+ av_init_packet(&avpkt);
+ avpkt.data = buf;
+ avpkt.size = buf_size;
+
+ return avcodec_decode_audio3(avctx, samples, frame_size_ptr, &avpkt);
+}
+#endif
+
+int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples,
+ int *frame_size_ptr,
+ AVPacket *avpkt)
+{
int ret;
- if((avctx->codec->capabilities & CODEC_CAP_DELAY) || buf_size){
+ if((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size){
//FIXME remove the check below _after_ ensuring that all audio check that the available space is enough
if(*frame_size_ptr < AVCODEC_MAX_AUDIO_FRAME_SIZE){
av_log(avctx, AV_LOG_ERROR, "buffer smaller than AVCODEC_MAX_AUDIO_FRAME_SIZE\n");
@@ -565,8 +593,7 @@ int attribute_align_arg avcodec_decode_a
return -1;
}
- ret = avctx->codec->decode(avctx, samples, frame_size_ptr,
- buf, buf_size);
+ ret = avctx->codec->decode(avctx, samples, frame_size_ptr, avpkt);
avctx->frame_number++;
}else{
ret= 0;
@@ -575,15 +602,28 @@ int attribute_align_arg avcodec_decode_a
return ret;
}
+#if LIBAVCODEC_VERSION_MAJOR < 53
int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
int *got_sub_ptr,
const uint8_t *buf, int buf_size)
{
+ AVPacket avpkt;
+ av_init_packet(&avpkt);
+ avpkt.data = buf;
+ avpkt.size = buf_size;
+
+ return avcodec_decode_subtitle2(avctx, sub, got_sub_ptr, &avpkt);
+}
+#endif
+
+int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
+ int *got_sub_ptr,
+ AVPacket *avpkt)
+{
int ret;
*got_sub_ptr = 0;
- ret = avctx->codec->decode(avctx, sub, got_sub_ptr,
- buf, buf_size);
+ ret = avctx->codec->decode(avctx, sub, got_sub_ptr, avpkt);
if (*got_sub_ptr)
avctx->frame_number++;
return ret;
Modified: trunk/libavcodec/vb.c
==============================================================================
--- trunk/libavcodec/vb.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/vb.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -173,8 +173,10 @@ static int vb_decode_framedata(VBDecCont
return 0;
}
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
+static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
VBDecContext * const c = avctx->priv_data;
uint8_t *outptr, *srcptr;
int i, j;
Modified: trunk/libavcodec/vc1.c
==============================================================================
--- trunk/libavcodec/vc1.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/vc1.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -4136,8 +4136,10 @@ static av_cold int vc1_decode_init(AVCod
*/
static int vc1_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
VC1Context *v = avctx->priv_data;
MpegEncContext *s = &v->s;
AVFrame *pict = data;
Modified: trunk/libavcodec/vcr1.c
==============================================================================
--- trunk/libavcodec/vcr1.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/vcr1.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -43,8 +43,10 @@ typedef struct VCR1Context{
static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
VCR1Context * const a = avctx->priv_data;
AVFrame *picture = data;
AVFrame * const p= (AVFrame*)&a->picture;
Modified: trunk/libavcodec/vmdav.c
==============================================================================
--- trunk/libavcodec/vmdav.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/vmdav.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -366,8 +366,10 @@ static av_cold int vmdvideo_decode_init(
static int vmdvideo_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
VmdVideoContext *s = avctx->priv_data;
s->buf = buf;
@@ -521,8 +523,10 @@ static int vmdaudio_loadsound(VmdAudioCo
static int vmdaudio_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
VmdAudioContext *s = avctx->priv_data;
unsigned char *output_samples = (unsigned char *)data;
Modified: trunk/libavcodec/vmnc.c
==============================================================================
--- trunk/libavcodec/vmnc.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/vmnc.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -284,8 +284,10 @@ static int decode_hextile(VmncContext *c
return src - ssrc;
}
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
+static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
VmncContext * const c = avctx->priv_data;
uint8_t *outptr;
const uint8_t *src = buf;
Modified: trunk/libavcodec/vorbis_dec.c
==============================================================================
--- trunk/libavcodec/vorbis_dec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/vorbis_dec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -1560,8 +1560,10 @@ static int vorbis_parse_audio_packet(vor
static int vorbis_decode_frame(AVCodecContext *avccontext,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
vorbis_context *vc = avccontext->priv_data ;
GetBitContext *gb = &(vc->gb);
const float *channel_ptrs[vc->audio_channels];
Modified: trunk/libavcodec/vp3.c
==============================================================================
--- trunk/libavcodec/vp3.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/vp3.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -1800,8 +1800,10 @@ static av_cold int vp3_decode_init(AVCod
*/
static int vp3_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
Vp3DecodeContext *s = avctx->priv_data;
GetBitContext gb;
static int counter = 0;
Modified: trunk/libavcodec/vqavideo.c
==============================================================================
--- trunk/libavcodec/vqavideo.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/vqavideo.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -565,8 +565,10 @@ static void vqa_decode_chunk(VqaContext
static int vqa_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
VqaContext *s = avctx->priv_data;
s->buf = buf;
Modified: trunk/libavcodec/wavpack.c
==============================================================================
--- trunk/libavcodec/wavpack.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/wavpack.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -476,8 +476,10 @@ static av_cold int wavpack_decode_init(A
static int wavpack_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
WavpackContext *s = avctx->priv_data;
int16_t *samples = data;
int samplecount;
Modified: trunk/libavcodec/wmadec.c
==============================================================================
--- trunk/libavcodec/wmadec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/wmadec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -752,8 +752,10 @@ static int wma_decode_frame(WMACodecCont
static int wma_decode_superframe(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
WMACodecContext *s = avctx->priv_data;
int nb_frames, bit_offset, i, pos, len;
uint8_t *q;
Modified: trunk/libavcodec/wnv1.c
==============================================================================
--- trunk/libavcodec/wnv1.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/wnv1.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -58,8 +58,10 @@ static inline int wnv1_get_code(WNV1Cont
static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
WNV1Context * const l = avctx->priv_data;
AVFrame * const p= (AVFrame*)&l->pic;
unsigned char *Y,*U,*V;
Modified: trunk/libavcodec/ws-snd1.c
==============================================================================
--- trunk/libavcodec/ws-snd1.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/ws-snd1.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -48,8 +48,10 @@ static av_cold int ws_snd_decode_init(AV
static int ws_snd_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
// WSSNDContext *c = avctx->priv_data;
int in_size, out_size;
Modified: trunk/libavcodec/xan.c
==============================================================================
--- trunk/libavcodec/xan.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/xan.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -405,8 +405,10 @@ static void xan_wc4_decode_frame(XanCont
static int xan_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
XanContext *s = avctx->priv_data;
AVPaletteControl *palette_control = avctx->palctrl;
Modified: trunk/libavcodec/xl.c
==============================================================================
--- trunk/libavcodec/xl.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/xl.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -40,8 +40,10 @@ static const int xl_table[32] = {
static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
VideoXLContext * const a = avctx->priv_data;
AVFrame * const p= (AVFrame*)&a->pic;
uint8_t *Y, *U, *V;
Modified: trunk/libavcodec/xsubdec.c
==============================================================================
--- trunk/libavcodec/xsubdec.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/xsubdec.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -44,7 +44,9 @@ static uint64_t parse_timecode(const uin
}
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
- const uint8_t *buf, int buf_size) {
+ AVPacket *avpkt) {
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
AVSubtitle *sub = data;
const uint8_t *buf_end = buf + buf_size;
uint8_t *bitmap;
Modified: trunk/libavcodec/zmbv.c
==============================================================================
--- trunk/libavcodec/zmbv.c Tue Apr 7 17:37:26 2009 (r18350)
+++ trunk/libavcodec/zmbv.c Tue Apr 7 17:59:50 2009 (r18351)
@@ -392,8 +392,10 @@ static int zmbv_decode_intra(ZmbvContext
return 0;
}
-static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
+static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
ZmbvContext * const c = avctx->priv_data;
uint8_t *outptr;
int zret = Z_OK; // Zlib return code
8
16
09 Jul '10
Author: reimar
Date: Fri Apr 10 09:01:55 2009
New Revision: 18406
Log:
Add a ff_h264_free_context function and call it from the H.264 parser.
This ensures that the parser will no longer leak memory for all SPS/PPS it encounters.
Modified:
trunk/libavcodec/h264.c
trunk/libavcodec/h264.h
trunk/libavcodec/h264_parser.c
Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c Fri Apr 10 02:09:07 2009 (r18405)
+++ trunk/libavcodec/h264.c Fri Apr 10 09:01:55 2009 (r18406)
@@ -8083,10 +8083,8 @@ int main(void){
#endif /* TEST */
-static av_cold int decode_end(AVCodecContext *avctx)
+av_cold ff_h264_free_context(H264Context *h)
{
- H264Context *h = avctx->priv_data;
- MpegEncContext *s = &h->s;
int i;
av_freep(&h->rbsp_buffer[0]);
@@ -8098,6 +8096,14 @@ static av_cold int decode_end(AVCodecCon
for(i = 0; i < MAX_PPS_COUNT; i++)
av_freep(h->pps_buffers + i);
+}
+
+static av_cold int decode_end(AVCodecContext *avctx)
+{
+ H264Context *h = avctx->priv_data;
+ MpegEncContext *s = &h->s;
+
+ ff_h264_free_context(h);
MPV_common_end(s);
Modified: trunk/libavcodec/h264.h
==============================================================================
--- trunk/libavcodec/h264.h Fri Apr 10 02:09:07 2009 (r18405)
+++ trunk/libavcodec/h264.h Fri Apr 10 09:01:55 2009 (r18406)
@@ -569,4 +569,9 @@ const uint8_t *ff_h264_decode_nal(H264Co
*/
int ff_h264_decode_rbsp_trailing(H264Context *h, const uint8_t *src);
+/**
+ * frees any data that may have been allocated in the H264 context like SPS, PPS etc.
+ */
+av_cold ff_h264_free_context(H264Context *h);
+
#endif /* AVCODEC_H264_H */
Modified: trunk/libavcodec/h264_parser.c
==============================================================================
--- trunk/libavcodec/h264_parser.c Fri Apr 10 02:09:07 2009 (r18405)
+++ trunk/libavcodec/h264_parser.c Fri Apr 10 09:01:55 2009 (r18406)
@@ -306,6 +306,7 @@ static void close(AVCodecParserContext *
ParseContext *pc = &h->s.parse_context;
av_free(pc->buffer);
+ ff_h264_free_context(h);
}
4
7
Author: gb
Date: Thu Apr 2 10:49:33 2009
New Revision: 18312
Log:
Add VA API deps.
Modified:
trunk/configure
Modified: trunk/configure
==============================================================================
--- trunk/configure Thu Apr 2 10:48:06 2009 (r18311)
+++ trunk/configure Thu Apr 2 10:49:33 2009 (r18312)
@@ -1017,8 +1017,10 @@ flashsv_encoder_select="zlib"
flv_encoder_select="aandct"
h261_encoder_select="aandct"
h263_encoder_select="aandct"
+h263_vaapi_hwaccel_deps="va_va_h"
h263p_encoder_select="aandct"
h264_decoder_select="golomb"
+h264_vaapi_hwaccel_deps="va_va_h"
h264_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
imc_decoder_select="fft mdct"
jpegls_decoder_select="golomb"
@@ -1031,6 +1033,8 @@ mpeg2video_encoder_select="aandct"
mpeg4_encoder_select="aandct"
mpeg_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
mpeg1_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
+mpeg2_vaapi_hwaccel_deps="va_va_h"
+mpeg4_vaapi_hwaccel_deps="va_va_h"
mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
msmpeg4v1_encoder_select="aandct"
msmpeg4v2_encoder_select="aandct"
@@ -1053,6 +1057,7 @@ svq3_decoder_suggest="zlib"
tiff_decoder_suggest="zlib"
tiff_encoder_suggest="zlib"
tscc_decoder_select="zlib"
+vc1_vaapi_hwaccel_deps="va_va_h"
vc1_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
vorbis_decoder_select="fft mdct"
vorbis_encoder_select="fft mdct"
@@ -1062,6 +1067,7 @@ wmav2_decoder_select="fft mdct"
wmav2_encoder_select="fft mdct"
wmv1_encoder_select="aandct"
wmv2_encoder_select="aandct"
+wmv3_vaapi_hwaccel_deps="va_va_h"
wmv3_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
zlib_decoder_select="zlib"
zlib_encoder_select="zlib"
@@ -2009,6 +2015,7 @@ for thread in $THREADS_LIST; do
done
check_lib math.h sin -lm
+check_lib va/va.h vaInitialize -lva
# test for C99 functions in math.h
for func in llrint lrint lrintf round roundf truncf; do
4
9
r17786 - in trunk: Makefile cmdutils.c configure libavcodec/Makefile libavcodec/imgconvert.c libavcodec/imgconvert_template.c libavcodec/imgresample.c libavcodec/ppc/imgresample_altivec.c libavcode...
by subversion@mplayerhq.hu 25 Jan '10
by subversion@mplayerhq.hu 25 Jan '10
25 Jan '10
Author: michael
Date: Tue Mar 3 23:51:30 2009
New Revision: 17786
Log:
Remove old scaler.
Deleted:
trunk/libavcodec/imgconvert_template.c
trunk/libavcodec/imgresample.c
trunk/libavcodec/ppc/imgresample_altivec.c
trunk/libavcodec/ppc/imgresample_altivec.h
Modified:
trunk/Makefile
trunk/cmdutils.c
trunk/configure
trunk/libavcodec/Makefile
trunk/libavcodec/imgconvert.c
trunk/libavfilter/Makefile
Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile Tue Mar 3 21:25:21 2009 (r17785)
+++ trunk/Makefile Tue Mar 3 23:51:30 2009 (r17786)
@@ -20,9 +20,8 @@ ALLMANPAGES = $(addsuffix .1, $(BASENAME
FFLIBS-$(CONFIG_AVFILTER) += avfilter
FFLIBS-$(CONFIG_POSTPROC) += postproc
-FFLIBS-$(CONFIG_SWSCALE) += swscale
-FFLIBS := avdevice avformat avcodec avutil
+FFLIBS := avdevice avformat avcodec avutil swscale
DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
@@ -236,15 +235,6 @@ LAVF_REG = tests/data/lavf.regressio
ROTOZOOM_REG = tests/data/rotozoom.regression
VSYNTH_REG = tests/data/vsynth.regression
-ifneq ($(CONFIG_SWSCALE),yes)
-servertest codectest $(CODEC_TESTS) libavtest: swscale-error
-swscale-error:
- @echo
- @echo "This regression test requires --enable-swscale."
- @echo
- @exit 1
-endif
-
ifneq ($(CONFIG_ZLIB),yes)
regtest-flashsv codectest: zlib-error
endif
Modified: trunk/cmdutils.c
==============================================================================
--- trunk/cmdutils.c Tue Mar 3 21:25:21 2009 (r17785)
+++ trunk/cmdutils.c Tue Mar 3 23:51:30 2009 (r17786)
@@ -280,9 +280,7 @@ static void print_all_lib_versions(FILE*
#if CONFIG_AVFILTER
PRINT_LIB_VERSION(outstream, avfilter, AVFILTER, indent);
#endif
-#if CONFIG_SWSCALE
PRINT_LIB_VERSION(outstream, swscale, SWSCALE, indent);
-#endif
#if CONFIG_POSTPROC
PRINT_LIB_VERSION(outstream, postproc, POSTPROC, indent);
#endif
Modified: trunk/configure
==============================================================================
--- trunk/configure Tue Mar 3 21:25:21 2009 (r17785)
+++ trunk/configure Tue Mar 3 23:51:30 2009 (r17786)
@@ -81,7 +81,6 @@ show_help(){
echo " --disable-ffplay disable ffplay build"
echo " --disable-ffserver disable ffserver build"
echo " --enable-postproc enable GPLed postprocessing support [no]"
- echo " --enable-swscale enable GPLed software scaler support [no]"
echo " --enable-avfilter video filter support [no]"
echo " --enable-avfilter-lavf video filters dependent on avformat [no]"
echo " --enable-beosthreads use BeOS threads [no]"
@@ -796,7 +795,6 @@ CONFIG_LIST="
shared
small
static
- swscale
vdpau
x11grab
zlib
@@ -912,7 +910,6 @@ HAVE_LIST="
# options emitted with CONFIG_ prefix but not available on command line
CONFIG_EXTRA="
- oldscaler
"
CMDLINE_SELECT="
@@ -980,9 +977,6 @@ sse_deps="mmx"
ssse3_deps="sse"
vis_deps="sparc"
-# common features
-oldscaler_deps="!swscale"
-
# decoders / encoders
aac_decoder_select="fft mdct"
ac3_decoder_deps="gpl"
@@ -1170,7 +1164,6 @@ enable ffserver
enable ipv6
enable mpegaudio_hp
enable network
-enable oldscaler
enable optimizations
enable protocols
enable static
@@ -1691,7 +1684,6 @@ if ! enabled gpl; then
die_gpl_disabled "libxvidcore" libxvid
die_gpl_disabled "FAAD2" libfaad2
die_gpl_disabled "The X11 grabber" x11grab
- die_gpl_disabled "The software scaler" swscale
fi
if ! enabled nonfree && enabled_any libamr_nb libamr_wb; then
@@ -2265,7 +2257,6 @@ echo "optimizations ${optimi
echo "static ${static-no}"
echo "shared ${shared-no}"
echo "postprocessing support ${postproc-no}"
-echo "software scaler enabled ${swscale-no}"
echo "new filter support ${avfilter-no}"
echo "filters using lavformat ${avfilter_lavf-no}"
echo "network support ${network-no}"
@@ -2549,9 +2540,4 @@ enabled avfilter &&
pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
enabled postproc &&
pkgconfig_generate libpostproc "FFmpeg post processing library" "$LIBPOSTPROC_VERSION"
-if enabled swscale; then
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"
-else
- pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "libavcodec = $LIBAVCODEC_VERSION"
- apply libswscale/libswscale.pc sed s/^Libs:.*$/Libs:/
-fi
Modified: trunk/libavcodec/Makefile
==============================================================================
--- trunk/libavcodec/Makefile Tue Mar 3 21:25:21 2009 (r17785)
+++ trunk/libavcodec/Makefile Tue Mar 3 23:51:30 2009 (r17786)
@@ -29,7 +29,6 @@ OBJS-$(CONFIG_ENCODERS) +
OBJS-$(CONFIG_FFT) += fft.o
OBJS-$(CONFIG_GOLOMB) += golomb.o
OBJS-$(CONFIG_MDCT) += mdct.o
-OBJS-$(CONFIG_OLDSCALER) += imgresample.o
OBJS-$(CONFIG_RDFT) += rdft.o
# decoders/encoders
@@ -494,7 +493,6 @@ OBJS-$(ARCH_BFIN) +
OBJS-$(ARCH_PPC) += ppc/dsputil_ppc.o \
ALTIVEC-OBJS-$(CONFIG_H264_DECODER) += ppc/h264_altivec.o
-ALTIVEC-OBJS-$(CONFIG_OLDSCALER) += ppc/imgresample_altivec.o
ALTIVEC-OBJS-$(CONFIG_SNOW_DECODER) += ppc/snow_altivec.o
ALTIVEC-OBJS-$(CONFIG_VC1_DECODER) += ppc/vc1dsp_altivec.o
ALTIVEC-OBJS-$(CONFIG_WMV3_DECODER) += ppc/vc1dsp_altivec.o
@@ -525,7 +523,6 @@ OBJS-$(HAVE_VIS) +
TESTS = $(addsuffix -test$(EXESUF), cabac dct eval fft h264 rangecoder snow)
-TESTS-$(CONFIG_OLDSCALER) += imgresample-test$(EXESUF)
TESTS-$(ARCH_X86) += x86/cpuid-test$(EXESUF) motion-test$(EXESUF)
CLEANFILES = apiexample$(EXESUF)
Modified: trunk/libavcodec/imgconvert.c
==============================================================================
--- trunk/libavcodec/imgconvert.c Tue Mar 3 21:25:21 2009 (r17785)
+++ trunk/libavcodec/imgconvert.c Tue Mar 3 23:51:30 2009 (r17786)
@@ -1033,357 +1033,6 @@ void av_picture_copy(AVPicture *dst, con
}
}
-/* XXX: totally non optimized */
-
-static void yuyv422_to_yuv420p(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const uint8_t *p, *p1;
- uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1;
- int w;
-
- p1 = src->data[0];
- lum1 = dst->data[0];
- cb1 = dst->data[1];
- cr1 = dst->data[2];
-
- for(;height >= 1; height -= 2) {
- p = p1;
- lum = lum1;
- cb = cb1;
- cr = cr1;
- for(w = width; w >= 2; w -= 2) {
- lum[0] = p[0];
- cb[0] = p[1];
- lum[1] = p[2];
- cr[0] = p[3];
- p += 4;
- lum += 2;
- cb++;
- cr++;
- }
- if (w) {
- lum[0] = p[0];
- cb[0] = p[1];
- cr[0] = p[3];
- cb++;
- cr++;
- }
- p1 += src->linesize[0];
- lum1 += dst->linesize[0];
- if (height>1) {
- p = p1;
- lum = lum1;
- for(w = width; w >= 2; w -= 2) {
- lum[0] = p[0];
- lum[1] = p[2];
- p += 4;
- lum += 2;
- }
- if (w) {
- lum[0] = p[0];
- }
- p1 += src->linesize[0];
- lum1 += dst->linesize[0];
- }
- cb1 += dst->linesize[1];
- cr1 += dst->linesize[2];
- }
-}
-
-static void uyvy422_to_yuv420p(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const uint8_t *p, *p1;
- uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1;
- int w;
-
- p1 = src->data[0];
-
- lum1 = dst->data[0];
- cb1 = dst->data[1];
- cr1 = dst->data[2];
-
- for(;height >= 1; height -= 2) {
- p = p1;
- lum = lum1;
- cb = cb1;
- cr = cr1;
- for(w = width; w >= 2; w -= 2) {
- lum[0] = p[1];
- cb[0] = p[0];
- lum[1] = p[3];
- cr[0] = p[2];
- p += 4;
- lum += 2;
- cb++;
- cr++;
- }
- if (w) {
- lum[0] = p[1];
- cb[0] = p[0];
- cr[0] = p[2];
- cb++;
- cr++;
- }
- p1 += src->linesize[0];
- lum1 += dst->linesize[0];
- if (height>1) {
- p = p1;
- lum = lum1;
- for(w = width; w >= 2; w -= 2) {
- lum[0] = p[1];
- lum[1] = p[3];
- p += 4;
- lum += 2;
- }
- if (w) {
- lum[0] = p[1];
- }
- p1 += src->linesize[0];
- lum1 += dst->linesize[0];
- }
- cb1 += dst->linesize[1];
- cr1 += dst->linesize[2];
- }
-}
-
-
-static void uyvy422_to_yuv422p(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const uint8_t *p, *p1;
- uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1;
- int w;
-
- p1 = src->data[0];
- lum1 = dst->data[0];
- cb1 = dst->data[1];
- cr1 = dst->data[2];
- for(;height > 0; height--) {
- p = p1;
- lum = lum1;
- cb = cb1;
- cr = cr1;
- for(w = width; w >= 2; w -= 2) {
- lum[0] = p[1];
- cb[0] = p[0];
- lum[1] = p[3];
- cr[0] = p[2];
- p += 4;
- lum += 2;
- cb++;
- cr++;
- }
- p1 += src->linesize[0];
- lum1 += dst->linesize[0];
- cb1 += dst->linesize[1];
- cr1 += dst->linesize[2];
- }
-}
-
-
-static void yuyv422_to_yuv422p(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const uint8_t *p, *p1;
- uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1;
- int w;
-
- p1 = src->data[0];
- lum1 = dst->data[0];
- cb1 = dst->data[1];
- cr1 = dst->data[2];
- for(;height > 0; height--) {
- p = p1;
- lum = lum1;
- cb = cb1;
- cr = cr1;
- for(w = width; w >= 2; w -= 2) {
- lum[0] = p[0];
- cb[0] = p[1];
- lum[1] = p[2];
- cr[0] = p[3];
- p += 4;
- lum += 2;
- cb++;
- cr++;
- }
- p1 += src->linesize[0];
- lum1 += dst->linesize[0];
- cb1 += dst->linesize[1];
- cr1 += dst->linesize[2];
- }
-}
-
-static void yuv422p_to_yuyv422(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- uint8_t *p, *p1;
- const uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1;
- int w;
-
- p1 = dst->data[0];
- lum1 = src->data[0];
- cb1 = src->data[1];
- cr1 = src->data[2];
- for(;height > 0; height--) {
- p = p1;
- lum = lum1;
- cb = cb1;
- cr = cr1;
- for(w = width; w >= 2; w -= 2) {
- p[0] = lum[0];
- p[1] = cb[0];
- p[2] = lum[1];
- p[3] = cr[0];
- p += 4;
- lum += 2;
- cb++;
- cr++;
- }
- p1 += dst->linesize[0];
- lum1 += src->linesize[0];
- cb1 += src->linesize[1];
- cr1 += src->linesize[2];
- }
-}
-
-static void yuv422p_to_uyvy422(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- uint8_t *p, *p1;
- const uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1;
- int w;
-
- p1 = dst->data[0];
- lum1 = src->data[0];
- cb1 = src->data[1];
- cr1 = src->data[2];
- for(;height > 0; height--) {
- p = p1;
- lum = lum1;
- cb = cb1;
- cr = cr1;
- for(w = width; w >= 2; w -= 2) {
- p[1] = lum[0];
- p[0] = cb[0];
- p[3] = lum[1];
- p[2] = cr[0];
- p += 4;
- lum += 2;
- cb++;
- cr++;
- }
- p1 += dst->linesize[0];
- lum1 += src->linesize[0];
- cb1 += src->linesize[1];
- cr1 += src->linesize[2];
- }
-}
-
-static void uyyvyy411_to_yuv411p(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- const uint8_t *p, *p1;
- uint8_t *lum, *cr, *cb, *lum1, *cr1, *cb1;
- int w;
-
- p1 = src->data[0];
- lum1 = dst->data[0];
- cb1 = dst->data[1];
- cr1 = dst->data[2];
- for(;height > 0; height--) {
- p = p1;
- lum = lum1;
- cb = cb1;
- cr = cr1;
- for(w = width; w >= 4; w -= 4) {
- cb[0] = p[0];
- lum[0] = p[1];
- lum[1] = p[2];
- cr[0] = p[3];
- lum[2] = p[4];
- lum[3] = p[5];
- p += 6;
- lum += 4;
- cb++;
- cr++;
- }
- p1 += src->linesize[0];
- lum1 += dst->linesize[0];
- cb1 += dst->linesize[1];
- cr1 += dst->linesize[2];
- }
-}
-
-
-static void yuv420p_to_yuyv422(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- int w, h;
- uint8_t *line1, *line2, *linesrc = dst->data[0];
- uint8_t *lum1, *lum2, *lumsrc = src->data[0];
- uint8_t *cb1, *cb2 = src->data[1];
- uint8_t *cr1, *cr2 = src->data[2];
-
- for(h = height / 2; h--;) {
- line1 = linesrc;
- line2 = linesrc + dst->linesize[0];
-
- lum1 = lumsrc;
- lum2 = lumsrc + src->linesize[0];
-
- cb1 = cb2;
- cr1 = cr2;
-
- for(w = width / 2; w--;) {
- *line1++ = *lum1++; *line2++ = *lum2++;
- *line1++ = *line2++ = *cb1++;
- *line1++ = *lum1++; *line2++ = *lum2++;
- *line1++ = *line2++ = *cr1++;
- }
-
- linesrc += dst->linesize[0] * 2;
- lumsrc += src->linesize[0] * 2;
- cb2 += src->linesize[1];
- cr2 += src->linesize[2];
- }
-}
-
-static void yuv420p_to_uyvy422(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- int w, h;
- uint8_t *line1, *line2, *linesrc = dst->data[0];
- uint8_t *lum1, *lum2, *lumsrc = src->data[0];
- uint8_t *cb1, *cb2 = src->data[1];
- uint8_t *cr1, *cr2 = src->data[2];
-
- for(h = height / 2; h--;) {
- line1 = linesrc;
- line2 = linesrc + dst->linesize[0];
-
- lum1 = lumsrc;
- lum2 = lumsrc + src->linesize[0];
-
- cb1 = cb2;
- cr1 = cr2;
-
- for(w = width / 2; w--;) {
- *line1++ = *line2++ = *cb1++;
- *line1++ = *lum1++; *line2++ = *lum2++;
- *line1++ = *line2++ = *cr1++;
- *line1++ = *lum1++; *line2++ = *lum2++;
- }
-
- linesrc += dst->linesize[0] * 2;
- lumsrc += src->linesize[0] * 2;
- cb2 += src->linesize[1];
- cr2 += src->linesize[2];
- }
-}
-
/* 2x2 -> 1x1 */
void ff_shrink22(uint8_t *dst, int dst_wrap,
const uint8_t *src, int src_wrap,
@@ -1470,622 +1119,6 @@ void ff_shrink88(uint8_t *dst, int dst_w
}
}
-/* XXX: add jpeg quantize code */
-
-#define TRANSP_INDEX (6*6*6)
-
-/* this is maybe slow, but allows for extensions */
-static inline unsigned char gif_clut_index(uint8_t r, uint8_t g, uint8_t b)
-{
- return (((r) / 47) % 6) * 6 * 6 + (((g) / 47) % 6) * 6 + (((b) / 47) % 6);
-}
-
-static void build_rgb_palette(uint8_t *palette, int has_alpha)
-{
- uint32_t *pal;
- static const uint8_t pal_value[6] = { 0x00, 0x33, 0x66, 0x99, 0xcc, 0xff };
- int i, r, g, b;
-
- pal = (uint32_t *)palette;
- i = 0;
- for(r = 0; r < 6; r++) {
- for(g = 0; g < 6; g++) {
- for(b = 0; b < 6; b++) {
- pal[i++] = (0xff << 24) | (pal_value[r] << 16) |
- (pal_value[g] << 8) | pal_value[b];
- }
- }
- }
- if (has_alpha)
- pal[i++] = 0;
- while (i < 256)
- pal[i++] = 0xff000000;
-}
-
-/* copy bit n to bits 0 ... n - 1 */
-static inline unsigned int bitcopy_n(unsigned int a, int n)
-{
- int mask;
- mask = (1 << n) - 1;
- return (a & (0xff & ~mask)) | ((-((a >> n) & 1)) & mask);
-}
-
-/* rgb555 handling */
-
-#define RGB_NAME rgb555
-
-#define RGB_IN(r, g, b, s)\
-{\
- unsigned int v = ((const uint16_t *)(s))[0];\
- r = bitcopy_n(v >> (10 - 3), 3);\
- g = bitcopy_n(v >> (5 - 3), 3);\
- b = bitcopy_n(v << 3, 3);\
-}
-
-
-#define RGB_OUT(d, r, g, b)\
-{\
- ((uint16_t *)(d))[0] = ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3);\
-}
-
-#define BPP 2
-
-#include "imgconvert_template.c"
-
-/* rgb565 handling */
-
-#define RGB_NAME rgb565
-
-#define RGB_IN(r, g, b, s)\
-{\
- unsigned int v = ((const uint16_t *)(s))[0];\
- r = bitcopy_n(v >> (11 - 3), 3);\
- g = bitcopy_n(v >> (5 - 2), 2);\
- b = bitcopy_n(v << 3, 3);\
-}
-
-#define RGB_OUT(d, r, g, b)\
-{\
- ((uint16_t *)(d))[0] = ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);\
-}
-
-#define BPP 2
-
-#include "imgconvert_template.c"
-
-/* bgr24 handling */
-
-#define RGB_NAME bgr24
-
-#define RGB_IN(r, g, b, s)\
-{\
- b = (s)[0];\
- g = (s)[1];\
- r = (s)[2];\
-}
-
-#define RGB_OUT(d, r, g, b)\
-{\
- (d)[0] = b;\
- (d)[1] = g;\
- (d)[2] = r;\
-}
-
-#define BPP 3
-
-#include "imgconvert_template.c"
-
-#undef RGB_IN
-#undef RGB_OUT
-#undef BPP
-
-/* rgb24 handling */
-
-#define RGB_NAME rgb24
-#define FMT_RGB24
-
-#define RGB_IN(r, g, b, s)\
-{\
- r = (s)[0];\
- g = (s)[1];\
- b = (s)[2];\
-}
-
-#define RGB_OUT(d, r, g, b)\
-{\
- (d)[0] = r;\
- (d)[1] = g;\
- (d)[2] = b;\
-}
-
-#define BPP 3
-
-#include "imgconvert_template.c"
-
-/* rgb32 handling */
-
-#define RGB_NAME rgb32
-#define FMT_RGB32
-
-#define RGB_IN(r, g, b, s)\
-{\
- unsigned int v = ((const uint32_t *)(s))[0];\
- r = (v >> 16) & 0xff;\
- g = (v >> 8) & 0xff;\
- b = v & 0xff;\
-}
-
-#define RGBA_IN(r, g, b, a, s)\
-{\
- unsigned int v = ((const uint32_t *)(s))[0];\
- a = (v >> 24) & 0xff;\
- r = (v >> 16) & 0xff;\
- g = (v >> 8) & 0xff;\
- b = v & 0xff;\
-}
-
-#define RGBA_OUT(d, r, g, b, a)\
-{\
- ((uint32_t *)(d))[0] = (a << 24) | (r << 16) | (g << 8) | b;\
-}
-
-#define BPP 4
-
-#include "imgconvert_template.c"
-
-static void mono_to_gray(AVPicture *dst, const AVPicture *src,
- int width, int height, int xor_mask)
-{
- const unsigned char *p;
- unsigned char *q;
- int v, dst_wrap, src_wrap;
- int y, w;
-
- p = src->data[0];
- src_wrap = src->linesize[0] - ((width + 7) >> 3);
-
- q = dst->data[0];
- dst_wrap = dst->linesize[0] - width;
- for(y=0;y<height;y++) {
- w = width;
- while (w >= 8) {
- v = *p++ ^ xor_mask;
- q[0] = -(v >> 7);
- q[1] = -((v >> 6) & 1);
- q[2] = -((v >> 5) & 1);
- q[3] = -((v >> 4) & 1);
- q[4] = -((v >> 3) & 1);
- q[5] = -((v >> 2) & 1);
- q[6] = -((v >> 1) & 1);
- q[7] = -((v >> 0) & 1);
- w -= 8;
- q += 8;
- }
- if (w > 0) {
- v = *p++ ^ xor_mask;
- do {
- q[0] = -((v >> 7) & 1);
- q++;
- v <<= 1;
- } while (--w);
- }
- p += src_wrap;
- q += dst_wrap;
- }
-}
-
-static void monowhite_to_gray(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- mono_to_gray(dst, src, width, height, 0xff);
-}
-
-static void monoblack_to_gray(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- mono_to_gray(dst, src, width, height, 0x00);
-}
-
-static void gray_to_mono(AVPicture *dst, const AVPicture *src,
- int width, int height, int xor_mask)
-{
- int n;
- const uint8_t *s;
- uint8_t *d;
- int j, b, v, n1, src_wrap, dst_wrap, y;
-
- s = src->data[0];
- src_wrap = src->linesize[0] - width;
-
- d = dst->data[0];
- dst_wrap = dst->linesize[0] - ((width + 7) >> 3);
-
- for(y=0;y<height;y++) {
- n = width;
- while (n >= 8) {
- v = 0;
- for(j=0;j<8;j++) {
- b = s[0];
- s++;
- v = (v << 1) | (b >> 7);
- }
- d[0] = v ^ xor_mask;
- d++;
- n -= 8;
- }
- if (n > 0) {
- n1 = n;
- v = 0;
- while (n > 0) {
- b = s[0];
- s++;
- v = (v << 1) | (b >> 7);
- n--;
- }
- d[0] = (v << (8 - (n1 & 7))) ^ xor_mask;
- d++;
- }
- s += src_wrap;
- d += dst_wrap;
- }
-}
-
-static void gray_to_monowhite(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- gray_to_mono(dst, src, width, height, 0xff);
-}
-
-static void gray_to_monoblack(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- gray_to_mono(dst, src, width, height, 0x00);
-}
-
-static void gray_to_gray16(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- int x, y, src_wrap, dst_wrap;
- uint8_t *s, *d;
- s = src->data[0];
- src_wrap = src->linesize[0] - width;
- d = dst->data[0];
- dst_wrap = dst->linesize[0] - width * 2;
- for(y=0; y<height; y++){
- for(x=0; x<width; x++){
- *d++ = *s;
- *d++ = *s++;
- }
- s += src_wrap;
- d += dst_wrap;
- }
-}
-
-static void gray16_to_gray(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- int x, y, src_wrap, dst_wrap;
- uint8_t *s, *d;
- s = src->data[0];
- src_wrap = src->linesize[0] - width * 2;
- d = dst->data[0];
- dst_wrap = dst->linesize[0] - width;
- for(y=0; y<height; y++){
- for(x=0; x<width; x++){
- *d++ = *s;
- s += 2;
- }
- s += src_wrap;
- d += dst_wrap;
- }
-}
-
-static void gray16be_to_gray(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- gray16_to_gray(dst, src, width, height);
-}
-
-static void gray16le_to_gray(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- AVPicture tmpsrc = *src;
- tmpsrc.data[0]++;
- gray16_to_gray(dst, &tmpsrc, width, height);
-}
-
-static void gray16_to_gray16(AVPicture *dst, const AVPicture *src,
- int width, int height)
-{
- int x, y, src_wrap, dst_wrap;
- uint16_t *s, *d;
- s = (uint16_t*)src->data[0];
- src_wrap = (src->linesize[0] - width * 2)/2;
- d = (uint16_t*)dst->data[0];
- dst_wrap = (dst->linesize[0] - width * 2)/2;
- for(y=0; y<height; y++){
- for(x=0; x<width; x++){
- *d++ = bswap_16(*s++);
- }
- s += src_wrap;
- d += dst_wrap;
- }
-}
-
-
-typedef struct ConvertEntry {
- void (*convert)(AVPicture *dst,
- const AVPicture *src, int width, int height);
-} ConvertEntry;
-
-/* Add each new conversion function in this table. In order to be able
- to convert from any format to any format, the following constraints
- must be satisfied:
-
- - all FF_COLOR_RGB formats must convert to and from PIX_FMT_RGB24
-
- - all FF_COLOR_GRAY formats must convert to and from PIX_FMT_GRAY8
-
- - all FF_COLOR_RGB formats with alpha must convert to and from PIX_FMT_RGB32
-
- - PIX_FMT_YUV444P and PIX_FMT_YUVJ444P must convert to and from
- PIX_FMT_RGB24.
-
- - PIX_FMT_422 must convert to and from PIX_FMT_422P.
-
- The other conversion functions are just optimizations for common cases.
-*/
-static const ConvertEntry convert_table[PIX_FMT_NB][PIX_FMT_NB] = {
- [PIX_FMT_YUV420P] = {
- [PIX_FMT_YUYV422] = {
- .convert = yuv420p_to_yuyv422,
- },
- [PIX_FMT_RGB555] = {
- .convert = yuv420p_to_rgb555
- },
- [PIX_FMT_RGB565] = {
- .convert = yuv420p_to_rgb565
- },
- [PIX_FMT_BGR24] = {
- .convert = yuv420p_to_bgr24
- },
- [PIX_FMT_RGB24] = {
- .convert = yuv420p_to_rgb24
- },
- [PIX_FMT_RGB32] = {
- .convert = yuv420p_to_rgb32
- },
- [PIX_FMT_UYVY422] = {
- .convert = yuv420p_to_uyvy422,
- },
- },
- [PIX_FMT_YUV422P] = {
- [PIX_FMT_YUYV422] = {
- .convert = yuv422p_to_yuyv422,
- },
- [PIX_FMT_UYVY422] = {
- .convert = yuv422p_to_uyvy422,
- },
- },
- [PIX_FMT_YUV444P] = {
- [PIX_FMT_RGB24] = {
- .convert = yuv444p_to_rgb24
- },
- },
- [PIX_FMT_YUVJ420P] = {
- [PIX_FMT_RGB555] = {
- .convert = yuvj420p_to_rgb555
- },
- [PIX_FMT_RGB565] = {
- .convert = yuvj420p_to_rgb565
- },
- [PIX_FMT_BGR24] = {
- .convert = yuvj420p_to_bgr24
- },
- [PIX_FMT_RGB24] = {
- .convert = yuvj420p_to_rgb24
- },
- [PIX_FMT_RGB32] = {
- .convert = yuvj420p_to_rgb32
- },
- },
- [PIX_FMT_YUVJ444P] = {
- [PIX_FMT_RGB24] = {
- .convert = yuvj444p_to_rgb24
- },
- },
- [PIX_FMT_YUYV422] = {
- [PIX_FMT_YUV420P] = {
- .convert = yuyv422_to_yuv420p,
- },
- [PIX_FMT_YUV422P] = {
- .convert = yuyv422_to_yuv422p,
- },
- },
- [PIX_FMT_UYVY422] = {
- [PIX_FMT_YUV420P] = {
- .convert = uyvy422_to_yuv420p,
- },
- [PIX_FMT_YUV422P] = {
- .convert = uyvy422_to_yuv422p,
- },
- },
- [PIX_FMT_RGB24] = {
- [PIX_FMT_YUV420P] = {
- .convert = rgb24_to_yuv420p
- },
- [PIX_FMT_RGB565] = {
- .convert = rgb24_to_rgb565
- },
- [PIX_FMT_RGB555] = {
- .convert = rgb24_to_rgb555
- },
- [PIX_FMT_RGB32] = {
- .convert = rgb24_to_rgb32
- },
- [PIX_FMT_BGR24] = {
- .convert = rgb24_to_bgr24
- },
- [PIX_FMT_GRAY8] = {
- .convert = rgb24_to_gray
- },
- [PIX_FMT_PAL8] = {
- .convert = rgb24_to_pal8
- },
- [PIX_FMT_YUV444P] = {
- .convert = rgb24_to_yuv444p
- },
- [PIX_FMT_YUVJ420P] = {
- .convert = rgb24_to_yuvj420p
- },
- [PIX_FMT_YUVJ444P] = {
- .convert = rgb24_to_yuvj444p
- },
- },
- [PIX_FMT_RGB32] = {
- [PIX_FMT_RGB24] = {
- .convert = rgb32_to_rgb24
- },
- [PIX_FMT_BGR24] = {
- .convert = rgb32_to_bgr24
- },
- [PIX_FMT_RGB565] = {
- .convert = rgb32_to_rgb565
- },
- [PIX_FMT_RGB555] = {
- .convert = rgb32_to_rgb555
- },
- [PIX_FMT_PAL8] = {
- .convert = rgb32_to_pal8
- },
- [PIX_FMT_YUV420P] = {
- .convert = rgb32_to_yuv420p
- },
- [PIX_FMT_GRAY8] = {
- .convert = rgb32_to_gray
- },
- },
- [PIX_FMT_BGR24] = {
- [PIX_FMT_RGB32] = {
- .convert = bgr24_to_rgb32
- },
- [PIX_FMT_RGB24] = {
- .convert = bgr24_to_rgb24
- },
- [PIX_FMT_YUV420P] = {
- .convert = bgr24_to_yuv420p
- },
- [PIX_FMT_GRAY8] = {
- .convert = bgr24_to_gray
- },
- },
- [PIX_FMT_RGB555] = {
- [PIX_FMT_RGB24] = {
- .convert = rgb555_to_rgb24
- },
- [PIX_FMT_RGB32] = {
- .convert = rgb555_to_rgb32
- },
- [PIX_FMT_YUV420P] = {
- .convert = rgb555_to_yuv420p
- },
- [PIX_FMT_GRAY8] = {
- .convert = rgb555_to_gray
- },
- },
- [PIX_FMT_RGB565] = {
- [PIX_FMT_RGB32] = {
- .convert = rgb565_to_rgb32
- },
- [PIX_FMT_RGB24] = {
- .convert = rgb565_to_rgb24
- },
- [PIX_FMT_YUV420P] = {
- .convert = rgb565_to_yuv420p
- },
- [PIX_FMT_GRAY8] = {
- .convert = rgb565_to_gray
- },
- },
- [PIX_FMT_GRAY16BE] = {
- [PIX_FMT_GRAY8] = {
- .convert = gray16be_to_gray
- },
- [PIX_FMT_GRAY16LE] = {
- .convert = gray16_to_gray16
- },
- },
- [PIX_FMT_GRAY16LE] = {
- [PIX_FMT_GRAY8] = {
- .convert = gray16le_to_gray
- },
- [PIX_FMT_GRAY16BE] = {
- .convert = gray16_to_gray16
- },
- },
- [PIX_FMT_GRAY8] = {
- [PIX_FMT_RGB555] = {
- .convert = gray_to_rgb555
- },
- [PIX_FMT_RGB565] = {
- .convert = gray_to_rgb565
- },
- [PIX_FMT_RGB24] = {
- .convert = gray_to_rgb24
- },
- [PIX_FMT_BGR24] = {
- .convert = gray_to_bgr24
- },
- [PIX_FMT_RGB32] = {
- .convert = gray_to_rgb32
- },
- [PIX_FMT_MONOWHITE] = {
- .convert = gray_to_monowhite
- },
- [PIX_FMT_MONOBLACK] = {
- .convert = gray_to_monoblack
- },
- [PIX_FMT_GRAY16LE] = {
- .convert = gray_to_gray16
- },
- [PIX_FMT_GRAY16BE] = {
- .convert = gray_to_gray16
- },
- },
- [PIX_FMT_MONOWHITE] = {
- [PIX_FMT_GRAY8] = {
- .convert = monowhite_to_gray
- },
- },
- [PIX_FMT_MONOBLACK] = {
- [PIX_FMT_GRAY8] = {
- .convert = monoblack_to_gray
- },
- },
- [PIX_FMT_PAL8] = {
- [PIX_FMT_RGB555] = {
- .convert = pal8_to_rgb555
- },
- [PIX_FMT_RGB565] = {
- .convert = pal8_to_rgb565
- },
- [PIX_FMT_BGR24] = {
- .convert = pal8_to_bgr24
- },
- [PIX_FMT_RGB24] = {
- .convert = pal8_to_rgb24
- },
- [PIX_FMT_RGB32] = {
- .convert = pal8_to_rgb32
- },
- },
- [PIX_FMT_UYYVYY411] = {
- [PIX_FMT_YUV411P] = {
- .convert = uyyvyy411_to_yuv411p,
- },
- },
-
-};
int avpicture_alloc(AVPicture *picture,
int pix_fmt, int width, int height)
@@ -2204,528 +1237,6 @@ int av_picture_pad(AVPicture *dst, const
return 0;
}
-#if !CONFIG_SWSCALE
-static uint8_t y_ccir_to_jpeg[256];
-static uint8_t y_jpeg_to_ccir[256];
-static uint8_t c_ccir_to_jpeg[256];
-static uint8_t c_jpeg_to_ccir[256];
-
-/* init various conversion tables */
-static av_cold void img_convert_init(void)
-{
- int i;
- uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
-
- for(i = 0;i < 256; i++) {
- y_ccir_to_jpeg[i] = Y_CCIR_TO_JPEG(i);
- y_jpeg_to_ccir[i] = Y_JPEG_TO_CCIR(i);
- c_ccir_to_jpeg[i] = C_CCIR_TO_JPEG(i);
- c_jpeg_to_ccir[i] = C_JPEG_TO_CCIR(i);
- }
-}
-
-/* apply to each pixel the given table */
-static void img_apply_table(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height, const uint8_t *table1)
-{
- int n;
- const uint8_t *s;
- uint8_t *d;
- const uint8_t *table;
-
- table = table1;
- for(;height > 0; height--) {
- s = src;
- d = dst;
- n = width;
- while (n >= 4) {
- d[0] = table[s[0]];
- d[1] = table[s[1]];
- d[2] = table[s[2]];
- d[3] = table[s[3]];
- d += 4;
- s += 4;
- n -= 4;
- }
- while (n > 0) {
- d[0] = table[s[0]];
- d++;
- s++;
- n--;
- }
- dst += dst_wrap;
- src += src_wrap;
- }
-}
-
-/* XXX: use generic filter ? */
-/* XXX: in most cases, the sampling position is incorrect */
-
-/* 4x1 -> 1x1 */
-static void shrink41(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- int w;
- const uint8_t *s;
- uint8_t *d;
-
- for(;height > 0; height--) {
- s = src;
- d = dst;
- for(w = width;w > 0; w--) {
- d[0] = (s[0] + s[1] + s[2] + s[3] + 2) >> 2;
- s += 4;
- d++;
- }
- src += src_wrap;
- dst += dst_wrap;
- }
-}
-
-/* 2x1 -> 1x1 */
-static void shrink21(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- int w;
- const uint8_t *s;
- uint8_t *d;
-
- for(;height > 0; height--) {
- s = src;
- d = dst;
- for(w = width;w > 0; w--) {
- d[0] = (s[0] + s[1]) >> 1;
- s += 2;
- d++;
- }
- src += src_wrap;
- dst += dst_wrap;
- }
-}
-
-/* 1x2 -> 1x1 */
-static void shrink12(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- int w;
- uint8_t *d;
- const uint8_t *s1, *s2;
-
- for(;height > 0; height--) {
- s1 = src;
- s2 = s1 + src_wrap;
- d = dst;
- for(w = width;w >= 4; w-=4) {
- d[0] = (s1[0] + s2[0]) >> 1;
- d[1] = (s1[1] + s2[1]) >> 1;
- d[2] = (s1[2] + s2[2]) >> 1;
- d[3] = (s1[3] + s2[3]) >> 1;
- s1 += 4;
- s2 += 4;
- d += 4;
- }
- for(;w > 0; w--) {
- d[0] = (s1[0] + s2[0]) >> 1;
- s1++;
- s2++;
- d++;
- }
- src += 2 * src_wrap;
- dst += dst_wrap;
- }
-}
-
-static void grow21_line(uint8_t *dst, const uint8_t *src,
- int width)
-{
- int w;
- const uint8_t *s1;
- uint8_t *d;
-
- s1 = src;
- d = dst;
- for(w = width;w >= 4; w-=4) {
- d[1] = d[0] = s1[0];
- d[3] = d[2] = s1[1];
- s1 += 2;
- d += 4;
- }
- for(;w >= 2; w -= 2) {
- d[1] = d[0] = s1[0];
- s1 ++;
- d += 2;
- }
- /* only needed if width is not a multiple of two */
- /* XXX: veryfy that */
- if (w) {
- d[0] = s1[0];
- }
-}
-
-static void grow41_line(uint8_t *dst, const uint8_t *src,
- int width)
-{
- int w, v;
- const uint8_t *s1;
- uint8_t *d;
-
- s1 = src;
- d = dst;
- for(w = width;w >= 4; w-=4) {
- v = s1[0];
- d[0] = v;
- d[1] = v;
- d[2] = v;
- d[3] = v;
- s1 ++;
- d += 4;
- }
-}
-
-/* 1x1 -> 2x1 */
-static void grow21(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- for(;height > 0; height--) {
- grow21_line(dst, src, width);
- src += src_wrap;
- dst += dst_wrap;
- }
-}
-
-/* 1x1 -> 1x2 */
-static void grow12(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- for(;height > 0; height-=2) {
- memcpy(dst, src, width);
- dst += dst_wrap;
- memcpy(dst, src, width);
- dst += dst_wrap;
- src += src_wrap;
- }
-}
-
-/* 1x1 -> 2x2 */
-static void grow22(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- for(;height > 0; height--) {
- grow21_line(dst, src, width);
- if (height%2)
- src += src_wrap;
- dst += dst_wrap;
- }
-}
-
-/* 1x1 -> 4x1 */
-static void grow41(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- for(;height > 0; height--) {
- grow41_line(dst, src, width);
- src += src_wrap;
- dst += dst_wrap;
- }
-}
-
-/* 1x1 -> 4x4 */
-static void grow44(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- for(;height > 0; height--) {
- grow41_line(dst, src, width);
- if ((height & 3) == 1)
- src += src_wrap;
- dst += dst_wrap;
- }
-}
-
-/* 1x2 -> 2x1 */
-static void conv411(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height)
-{
- int w, c;
- const uint8_t *s1, *s2;
- uint8_t *d;
-
- width>>=1;
-
- for(;height > 0; height--) {
- s1 = src;
- s2 = src + src_wrap;
- d = dst;
- for(w = width;w > 0; w--) {
- c = (s1[0] + s2[0]) >> 1;
- d[0] = c;
- d[1] = c;
- s1++;
- s2++;
- d += 2;
- }
- src += src_wrap * 2;
- dst += dst_wrap;
- }
-}
-
-/* XXX: always use linesize. Return -1 if not supported */
-int img_convert(AVPicture *dst, int dst_pix_fmt,
- const AVPicture *src, int src_pix_fmt,
- int src_width, int src_height)
-{
- static int initialized;
- int i, ret, dst_width, dst_height, int_pix_fmt;
- const PixFmtInfo *src_pix, *dst_pix;
- const ConvertEntry *ce;
- AVPicture tmp1, *tmp = &tmp1;
-
- if (src_pix_fmt < 0 || src_pix_fmt >= PIX_FMT_NB ||
- dst_pix_fmt < 0 || dst_pix_fmt >= PIX_FMT_NB)
- return -1;
- if (src_width <= 0 || src_height <= 0)
- return 0;
-
- if (!initialized) {
- initialized = 1;
- img_convert_init();
- }
-
- dst_width = src_width;
- dst_height = src_height;
-
- dst_pix = &pix_fmt_info[dst_pix_fmt];
- src_pix = &pix_fmt_info[src_pix_fmt];
- if (src_pix_fmt == dst_pix_fmt) {
- /* no conversion needed: just copy */
- av_picture_copy(dst, src, dst_pix_fmt, dst_width, dst_height);
- return 0;
- }
-
- ce = &convert_table[src_pix_fmt][dst_pix_fmt];
- if (ce->convert) {
- /* specific conversion routine */
- ce->convert(dst, src, dst_width, dst_height);
- return 0;
- }
-
- /* gray to YUV */
- if (is_yuv_planar(dst_pix) &&
- src_pix_fmt == PIX_FMT_GRAY8) {
- int w, h, y;
- uint8_t *d;
-
- if (dst_pix->color_type == FF_COLOR_YUV_JPEG) {
- ff_img_copy_plane(dst->data[0], dst->linesize[0],
- src->data[0], src->linesize[0],
- dst_width, dst_height);
- } else {
- img_apply_table(dst->data[0], dst->linesize[0],
- src->data[0], src->linesize[0],
- dst_width, dst_height,
- y_jpeg_to_ccir);
- }
- /* fill U and V with 128 */
- w = dst_width;
- h = dst_height;
- w >>= dst_pix->x_chroma_shift;
- h >>= dst_pix->y_chroma_shift;
- for(i = 1; i <= 2; i++) {
- d = dst->data[i];
- for(y = 0; y< h; y++) {
- memset(d, 128, w);
- d += dst->linesize[i];
- }
- }
- return 0;
- }
-
- /* YUV to gray */
- if (is_yuv_planar(src_pix) &&
- dst_pix_fmt == PIX_FMT_GRAY8) {
- if (src_pix->color_type == FF_COLOR_YUV_JPEG) {
- ff_img_copy_plane(dst->data[0], dst->linesize[0],
- src->data[0], src->linesize[0],
- dst_width, dst_height);
- } else {
- img_apply_table(dst->data[0], dst->linesize[0],
- src->data[0], src->linesize[0],
- dst_width, dst_height,
- y_ccir_to_jpeg);
- }
- return 0;
- }
-
- /* YUV to YUV planar */
- if (is_yuv_planar(dst_pix) && is_yuv_planar(src_pix)) {
- int x_shift, y_shift, w, h, xy_shift;
- void (*resize_func)(uint8_t *dst, int dst_wrap,
- const uint8_t *src, int src_wrap,
- int width, int height);
-
- /* compute chroma size of the smallest dimensions */
- w = dst_width;
- h = dst_height;
- if (dst_pix->x_chroma_shift >= src_pix->x_chroma_shift)
- w >>= dst_pix->x_chroma_shift;
- else
- w >>= src_pix->x_chroma_shift;
- if (dst_pix->y_chroma_shift >= src_pix->y_chroma_shift)
- h >>= dst_pix->y_chroma_shift;
- else
- h >>= src_pix->y_chroma_shift;
-
- x_shift = (dst_pix->x_chroma_shift - src_pix->x_chroma_shift);
- y_shift = (dst_pix->y_chroma_shift - src_pix->y_chroma_shift);
- xy_shift = ((x_shift & 0xf) << 4) | (y_shift & 0xf);
- /* there must be filters for conversion at least from and to
- YUV444 format */
- switch(xy_shift) {
- case 0x00:
- resize_func = ff_img_copy_plane;
- break;
- case 0x10:
- resize_func = shrink21;
- break;
- case 0x20:
- resize_func = shrink41;
- break;
- case 0x01:
- resize_func = shrink12;
- break;
- case 0x11:
- resize_func = ff_shrink22;
- break;
- case 0x22:
- resize_func = ff_shrink44;
- break;
- case 0xf0:
- resize_func = grow21;
- break;
- case 0x0f:
- resize_func = grow12;
- break;
- case 0xe0:
- resize_func = grow41;
- break;
- case 0xff:
- resize_func = grow22;
- break;
- case 0xee:
- resize_func = grow44;
- break;
- case 0xf1:
- resize_func = conv411;
- break;
- default:
- /* currently not handled */
- goto no_chroma_filter;
- }
-
- ff_img_copy_plane(dst->data[0], dst->linesize[0],
- src->data[0], src->linesize[0],
- dst_width, dst_height);
-
- for(i = 1;i <= 2; i++)
- resize_func(dst->data[i], dst->linesize[i],
- src->data[i], src->linesize[i],
- dst_width>>dst_pix->x_chroma_shift, dst_height>>dst_pix->y_chroma_shift);
- /* if yuv color space conversion is needed, we do it here on
- the destination image */
- if (dst_pix->color_type != src_pix->color_type) {
- const uint8_t *y_table, *c_table;
- if (dst_pix->color_type == FF_COLOR_YUV) {
- y_table = y_jpeg_to_ccir;
- c_table = c_jpeg_to_ccir;
- } else {
- y_table = y_ccir_to_jpeg;
- c_table = c_ccir_to_jpeg;
- }
- img_apply_table(dst->data[0], dst->linesize[0],
- dst->data[0], dst->linesize[0],
- dst_width, dst_height,
- y_table);
-
- for(i = 1;i <= 2; i++)
- img_apply_table(dst->data[i], dst->linesize[i],
- dst->data[i], dst->linesize[i],
- dst_width>>dst_pix->x_chroma_shift,
- dst_height>>dst_pix->y_chroma_shift,
- c_table);
- }
- return 0;
- }
- no_chroma_filter:
-
- /* try to use an intermediate format */
- if (src_pix_fmt == PIX_FMT_YUYV422 ||
- dst_pix_fmt == PIX_FMT_YUYV422) {
- /* specific case: convert to YUV422P first */
- int_pix_fmt = PIX_FMT_YUV422P;
- } else if (src_pix_fmt == PIX_FMT_UYVY422 ||
- dst_pix_fmt == PIX_FMT_UYVY422) {
- /* specific case: convert to YUV422P first */
- int_pix_fmt = PIX_FMT_YUV422P;
- } else if (src_pix_fmt == PIX_FMT_UYYVYY411 ||
- dst_pix_fmt == PIX_FMT_UYYVYY411) {
- /* specific case: convert to YUV411P first */
- int_pix_fmt = PIX_FMT_YUV411P;
- } else if ((src_pix->color_type == FF_COLOR_GRAY &&
- src_pix_fmt != PIX_FMT_GRAY8) ||
- (dst_pix->color_type == FF_COLOR_GRAY &&
- dst_pix_fmt != PIX_FMT_GRAY8)) {
- /* gray8 is the normalized format */
- int_pix_fmt = PIX_FMT_GRAY8;
- } else if ((is_yuv_planar(src_pix) &&
- src_pix_fmt != PIX_FMT_YUV444P &&
- src_pix_fmt != PIX_FMT_YUVJ444P)) {
- /* yuv444 is the normalized format */
- if (src_pix->color_type == FF_COLOR_YUV_JPEG)
- int_pix_fmt = PIX_FMT_YUVJ444P;
- else
- int_pix_fmt = PIX_FMT_YUV444P;
- } else if ((is_yuv_planar(dst_pix) &&
- dst_pix_fmt != PIX_FMT_YUV444P &&
- dst_pix_fmt != PIX_FMT_YUVJ444P)) {
- /* yuv444 is the normalized format */
- if (dst_pix->color_type == FF_COLOR_YUV_JPEG)
- int_pix_fmt = PIX_FMT_YUVJ444P;
- else
- int_pix_fmt = PIX_FMT_YUV444P;
- } else {
- /* the two formats are rgb or gray8 or yuv[j]444p */
- if (src_pix->is_alpha && dst_pix->is_alpha)
- int_pix_fmt = PIX_FMT_RGB32;
- else
- int_pix_fmt = PIX_FMT_RGB24;
- }
- if (src_pix_fmt == int_pix_fmt)
- return -1;
- if (avpicture_alloc(tmp, int_pix_fmt, dst_width, dst_height) < 0)
- return -1;
- ret = -1;
- if (img_convert(tmp, int_pix_fmt,
- src, src_pix_fmt, src_width, src_height) < 0)
- goto fail1;
- if (img_convert(dst, dst_pix_fmt,
- tmp, int_pix_fmt, dst_width, dst_height) < 0)
- goto fail1;
- ret = 0;
- fail1:
- avpicture_free(tmp);
- return ret;
-}
-#endif
-
/* NOTE: we scan all the pixels to have an exact information */
static int get_alpha_info_pal8(const AVPicture *src, int width, int height)
{
@@ -2763,9 +1274,6 @@ int img_get_alpha_info(const AVPicture *
if (!pf->is_alpha)
return 0;
switch(pix_fmt) {
- case PIX_FMT_RGB32:
- ret = get_alpha_info_rgb32(src, width, height);
- break;
case PIX_FMT_PAL8:
ret = get_alpha_info_pal8(src, width, height);
break;
Modified: trunk/libavfilter/Makefile
==============================================================================
--- trunk/libavfilter/Makefile Tue Mar 3 21:25:21 2009 (r17785)
+++ trunk/libavfilter/Makefile Tue Mar 3 23:51:30 2009 (r17786)
@@ -1,8 +1,7 @@
include $(SUBDIR)../config.mak
NAME = avfilter
-FFLIBS = avcodec avutil
-FFLIBS-$(CONFIG_SWSCALE) += swscale
+FFLIBS = avcodec avutil swscale
FFLIBS-$(CONFIG_AVFILTER_LAVF) += avformat
HEADERS = avfilter.h
9
8
Author: michael
Date: Wed Apr 8 22:48:44 2009
New Revision: 18381
Log:
Fix mb_height for interlaced mpeg2.
This correctly fixes issue961, thanks to steven warren for spoting my
mistake.
Modified:
trunk/libavcodec/mpeg12.c
trunk/libavcodec/mpegvideo.c
Modified: trunk/libavcodec/mpeg12.c
==============================================================================
--- trunk/libavcodec/mpeg12.c Wed Apr 8 22:26:18 2009 (r18380)
+++ trunk/libavcodec/mpeg12.c Wed Apr 8 22:48:44 2009 (r18381)
@@ -1160,7 +1160,7 @@ typedef struct Mpeg1Context {
int slice_count;
int swap_uv;//indicate VCR2
int save_aspect_info;
- int save_width, save_height;
+ int save_width, save_height, save_progressive_seq;
AVRational frame_rate_ext; ///< MPEG-2 specific framerate modificator
} Mpeg1Context;
@@ -1238,6 +1238,7 @@ static int mpeg_decode_postinit(AVCodecC
s1->save_width != s->width ||
s1->save_height != s->height ||
s1->save_aspect_info != s->aspect_ratio_info||
+ s1->save_progressive_seq != s->progressive_sequence ||
0)
{
@@ -1256,6 +1257,7 @@ static int mpeg_decode_postinit(AVCodecC
s1->save_aspect_info = s->aspect_ratio_info;
s1->save_width = s->width;
s1->save_height = s->height;
+ s1->save_progressive_seq = s->progressive_sequence;
/* low_delay may be forced, in this case we will have B-frames
* that behave like P-frames. */
Modified: trunk/libavcodec/mpegvideo.c
==============================================================================
--- trunk/libavcodec/mpegvideo.c Wed Apr 8 22:26:18 2009 (r18380)
+++ trunk/libavcodec/mpegvideo.c Wed Apr 8 22:48:44 2009 (r18381)
@@ -444,6 +444,9 @@ av_cold int MPV_common_init(MpegEncConte
{
int y_size, c_size, yc_size, i, mb_array_size, mv_table_size, x, y, threads;
+ if(s->codec_id == CODEC_ID_MPEG2VIDEO && !s->progressive_sequence)
+ s->mb_height = (s->height + 31) / 32 * 2;
+ else
s->mb_height = (s->height + 15) / 16;
if(s->avctx->pix_fmt == PIX_FMT_NONE){
4
11
Author: benoit
Date: Wed May 2 10:18:28 2007
New Revision: 8865
Log:
make mpeg decoder handle mid-stream changes in resolution
patch by Heikki Lindholm holindho at cs helsinki fi
original thread: [Ffmpeg-devel] [PATCH] fix mid-stream resolution changes
date: Sat Mar 31 13:52:50 CEST 2007
Modified:
trunk/libavcodec/mpeg12.c
Modified: trunk/libavcodec/mpeg12.c
==============================================================================
--- trunk/libavcodec/mpeg12.c (original)
+++ trunk/libavcodec/mpeg12.c Wed May 2 10:18:28 2007
@@ -2084,6 +2084,7 @@ typedef struct Mpeg1Context {
int slice_count;
int swap_uv;//indicate VCR2
int save_aspect_info;
+ int save_width, save_height;
AVRational frame_rate_ext; ///< MPEG-2 specific framerate modificator
} Mpeg1Context;
@@ -2138,6 +2139,8 @@ static int mpeg_decode_postinit(AVCodecC
(s1->mpeg_enc_ctx_allocated == 0)||
avctx->coded_width != s->width ||
avctx->coded_height != s->height||
+ s1->save_width != s->width ||
+ s1->save_height != s->height ||
s1->save_aspect_info != s->aspect_ratio_info||
0)
{
@@ -2155,6 +2158,8 @@ static int mpeg_decode_postinit(AVCodecC
avcodec_set_dimensions(avctx, s->width, s->height);
avctx->bit_rate = s->bit_rate;
s1->save_aspect_info = s->aspect_ratio_info;
+ s1->save_width = s->width;
+ s1->save_height = s->height;
//low_delay may be forced, in this case we will have B frames
//that behave like P frames
3
2
Author: mru
Date: Thu Aug 6 17:45:19 2009
New Revision: 19602
Log:
configure: support --cpu=host to tune for the host system
This requires a gcc version with -march=native or -mcpu=native support,
which is somewhat random for non-x86.
Modified:
trunk/configure
Modified: trunk/configure
==============================================================================
--- trunk/configure Thu Aug 6 17:04:59 2009 (r19601)
+++ trunk/configure Thu Aug 6 17:45:19 2009 (r19602)
@@ -1582,6 +1582,22 @@ if test -n "$sysroot"; then
esac
fi
+if test "$cpu" = host; then
+ enabled cross_compile && die "--cpu=host makes no sense when cross-compiling."
+
+ case "$cc_type" in
+ gcc)
+ check_native(){
+ $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
+ awk "/$1=/{ match(\$0, /$1=(\\w+)/, a);print a[1];exit }" $TMPE
+ }
+ cpu=$(check_native -march || check_native -mcpu)
+ ;;
+ esac
+
+ test "${cpu:-host}" = host && die "--cpu=host not supported with compiler $cc"
+fi
+
# Add processor-specific flags
case $cpu in
601|ppc601|PowerPC601)
3
3