From: Mike M. <tm...@us...> - 2003-10-27 15:25:07
|
Update of /cvsroot/xine/xine-lib/src/libffmpeg In directory sc8-pr-cvs1:/tmp/cvs-serv12361/src/libffmpeg Modified Files: diff_to_ffmpeg_cvs.txt xine_decoder.c Log Message: super mega ffmpeg tree sync Index: diff_to_ffmpeg_cvs.txt =================================================================== RCS file: /cvsroot/xine/xine-lib/src/libffmpeg/diff_to_ffmpeg_cvs.txt,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- diff_to_ffmpeg_cvs.txt 20 Oct 2003 00:33:28 -0000 1.12 +++ diff_to_ffmpeg_cvs.txt 27 Oct 2003 15:24:38 -0000 1.13 @@ -1,19 +1,18 @@ -? ffmpeg-030211.patch Index: libavcodec/common.h =================================================================== RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/common.h,v -retrieving revision 1.87 -diff -u -r1.87 common.h ---- libavcodec/common.h 26 Mar 2003 10:39:34 -0000 1.87 -+++ libavcodec/common.h 26 Mar 2003 13:49:18 -0000 -@@ -178,11 +178,19 @@ +retrieving revision 1.106 +diff -u -u -r1.106 common.h +--- libavcodec/common.h 20 Oct 2003 20:23:46 -0000 1.106 ++++ libavcodec/common.h 21 Oct 2003 12:10:49 -0000 +@@ -184,11 +184,19 @@ # else -# ifdef DEBUG --# define dprintf(fmt,args...) printf(fmt, ## args) +-# define dprintf(fmt,...) printf(fmt, __VA_ARGS__) -# else --# define dprintf(fmt,args...) +-# define dprintf(fmt,...) -# endif +#if __GNUC__ +#ifdef DEBUG @@ -34,10 +33,10 @@ Index: libavcodec/dsputil.h =================================================================== RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/dsputil.h,v -retrieving revision 1.60 -diff -u -r1.60 dsputil.h ---- libavcodec/dsputil.h 15 Mar 2003 02:06:09 -0000 1.60 -+++ libavcodec/dsputil.h 26 Mar 2003 13:49:18 -0000 +retrieving revision 1.74 +diff -u -u -r1.74 dsputil.h +--- libavcodec/dsputil.h 13 Oct 2003 17:27:30 -0000 1.74 ++++ libavcodec/dsputil.h 21 Oct 2003 12:10:51 -0000 @@ -29,9 +29,14 @@ #include "common.h" @@ -53,8 +52,8 @@ -//#define DEBUG /* dct code */ typedef short DCTELEM; - //typedef int DCTELEM; -@@ -310,21 +315,25 @@ + +@@ -317,21 +322,25 @@ #undef emms_c @@ -80,13 +79,106 @@ #define emms_c() \ +Index: libavcodec/fastmemcpy.h +=================================================================== +RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/fastmemcpy.h,v +retrieving revision 1.1 +diff -u -u -r1.1 fastmemcpy.h +--- libavcodec/fastmemcpy.h 2 Aug 2001 08:29:38 -0000 1.1 ++++ libavcodec/fastmemcpy.h 21 Oct 2003 12:10:53 -0000 +@@ -1 +1,8 @@ +-#include "../libvo/fastmemcpy.h" ++#ifndef __FASTMEMCPY_H__ ++#define __FASTMEMCPY_H__ ++ ++#include "xineutils.h" ++ ++#define memcpy(a,b,c) xine_fast_memcpy(a,b,c) ++ ++#endif +Index: libavcodec/mjpeg.c +=================================================================== +RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/mjpeg.c,v +retrieving revision 1.78 +diff -u -u -r1.78 mjpeg.c +--- libavcodec/mjpeg.c 20 Oct 2003 20:23:46 -0000 1.78 ++++ libavcodec/mjpeg.c 21 Oct 2003 12:11:08 -0000 +@@ -1504,7 +1504,7 @@ + 4bytes field_size + 4bytes field_size_less_padding + */ +- s->buggy_avid = 1; ++// s->buggy_avid = 1; + // if (s->first_picture) + // printf("mjpeg: workarounding buggy AVID\n"); + s->interlace_polarity = get_bits(&s->gb, 8); +Index: libavcodec/mpegvideo.c +=================================================================== +RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/mpegvideo.c,v +retrieving revision 1.291 +diff -u -u -r1.291 mpegvideo.c +--- libavcodec/mpegvideo.c 20 Oct 2003 09:52:02 -0000 1.291 ++++ libavcodec/mpegvideo.c 21 Oct 2003 12:11:17 -0000 +@@ -836,7 +836,9 @@ + if (MPV_common_init(s) < 0) + return -1; + ++#ifdef CONFIG_ENCODERS_FULL + ff_init_me(s); ++#endif + + #ifdef CONFIG_ENCODERS + #ifdef CONFIG_RISKY +@@ -1637,8 +1639,10 @@ + if (s->out_format == FMT_MJPEG) + mjpeg_picture_trailer(s); + ++#ifdef CONFIG_ENCODERS_FULL + if(s->flags&CODEC_FLAG_PASS1) + ff_write_pass1_stats(s); ++#endif + + for(i=0; i<4; i++){ + avctx->error[i] += s->current_picture_ptr->error[i]; +@@ -3362,6 +3366,7 @@ + /* Estimate motion for every MB */ + s->mb_intra=0; //for the rate distoration & bit compare functions + if(s->pict_type != I_TYPE){ ++#ifdef CONFIG_ENCODERS_FULL + if(s->pict_type != B_TYPE){ + if((s->avctx->pre_me && s->last_non_b_pict_type==I_TYPE) || s->avctx->pre_me==2){ + s->me.pre_pass=1; +@@ -3399,6 +3404,7 @@ + ff_estimate_p_frame_motion(s, mb_x, mb_y); + } + } ++#endif + }else /* if(s->pict_type == I_TYPE) */{ + /* I-Frame */ + //FIXME do we need to zero them? +@@ -3433,6 +3439,7 @@ + //printf("Scene change detected, encoding as I Frame %d %d\n", s->current_picture.mb_var_sum, s->current_picture.mc_mb_var_sum); + } + ++#ifdef CONFIG_ENCODERS_FULL + if(!s->umvplus){ + if(s->pict_type==P_TYPE || s->pict_type==S_TYPE) { + s->f_code= ff_get_best_fcode(s, s->p_mv_table, MB_TYPE_INTER); +@@ -3457,6 +3464,7 @@ + ff_fix_long_b_mvs(s, s->b_bidir_back_mv_table, s->b_code, MB_TYPE_BIDIR); + } + } ++#endif + + if (!s->fixed_qscale) + s->current_picture.quality = ff_rate_estimate_qscale(s); Index: libavcodec/i386/cputest.c =================================================================== RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/i386/cputest.c,v retrieving revision 1.8 -diff -u -r1.8 cputest.c +diff -u -u -r1.8 cputest.c --- libavcodec/i386/cputest.c 26 Nov 2002 16:26:58 -0000 1.8 -+++ libavcodec/i386/cputest.c 26 Mar 2003 13:49:19 -0000 ++++ libavcodec/i386/cputest.c 21 Oct 2003 12:11:37 -0000 @@ -1,122 +1,13 @@ -/* Cpu detection code, extracted from mmx.h ((c)1997-99 by H. Dietz - and R. Fisher). Converted to C and improved by Fabrice Bellard */ @@ -217,9 +309,9 @@ =================================================================== RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/i386/mmx.h,v retrieving revision 1.3 -diff -u -r1.3 mmx.h +diff -u -u -r1.3 mmx.h --- libavcodec/i386/mmx.h 27 May 2002 08:31:54 -0000 1.3 -+++ libavcodec/i386/mmx.h 26 Mar 2003 13:49:19 -0000 ++++ libavcodec/i386/mmx.h 21 Oct 2003 12:11:38 -0000 @@ -1,243 +1 @@ -/* - * mmx.h @@ -465,13 +557,29 @@ - -#endif /* AVCODEC_I386MMX_H */ +#include "xineutils.h" +Index: libavcodec/i386/motion_est_mmx.c +=================================================================== +RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/i386/motion_est_mmx.c,v +retrieving revision 1.11 +diff -u -u -r1.11 motion_est_mmx.c +--- libavcodec/i386/motion_est_mmx.c 9 Sep 2003 22:59:16 -0000 1.11 ++++ libavcodec/i386/motion_est_mmx.c 21 Oct 2003 12:11:39 -0000 +@@ -26,7 +26,7 @@ + 0x0002000200020002, + }; + +-static __attribute__ ((aligned(8), unused)) uint64_t bone= 0x0101010101010101LL; ++static const __attribute__ ((aligned(8), unused)) uint64_t bone= 0x0101010101010101LL; + + static inline void sad8_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h) + { Index: libavcodec/libpostproc/postprocess.c =================================================================== RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/libpostproc/postprocess.c,v -retrieving revision 1.83 -diff -u -r1.83 postprocess.c ---- libavcodec/libpostproc/postprocess.c 6 Mar 2003 13:51:18 -0000 1.83 -+++ libavcodec/libpostproc/postprocess.c 26 Mar 2003 13:49:20 -0000 +retrieving revision 1.90 +diff -u -u -r1.90 postprocess.c +--- libavcodec/libpostproc/postprocess.c 14 Sep 2003 16:52:34 -0000 1.90 ++++ libavcodec/libpostproc/postprocess.c 21 Oct 2003 12:11:40 -0000 @@ -70,8 +70,9 @@ #include "config.h" #include <inttypes.h> @@ -489,7 +597,7 @@ //#undef ARCH_X86 //#define DEBUG_BRIGHTNESS -#ifdef USE_FASTMEMCPY --#include "libvo/fastmemcpy.h" +-#include "../fastmemcpy.h" -#endif + +#define memcpy(a,b,c) xine_fast_memcpy(a,b,c) @@ -518,10 +626,13 @@ #endif -@@ -159,37 +160,6 @@ - } - #endif - +@@ -156,37 +157,6 @@ + static inline void unusedVariableWarningFixer() + { + if(w05 + w20 + b00 + b01 + b02 + b08 + b80 == 0) b00=0; +-} +-#endif +- - -#ifdef ARCH_X86 -static inline void prefetchnta(void *p) @@ -550,154 +661,17 @@ - asm volatile( "prefetcht2 (%0)\n\t" - : : "r" (p) - ); --} --#endif -- - // The horizontal Functions exist only in C cuz the MMX code is faster with vertical filters and transposing - - /** -Index: libavcodec/mjpeg.c -=================================================================== -RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/mjpeg.c,v -retrieving revision 1.61 -diff -u -r1.61 mjpeg.c ---- libavcodec/mjpeg.c 23 May 2003 16:04:24 -0000 1.61 -+++ libavcodec/mjpeg.c 23 May 2003 18:18:53 -0000 -@@ -1471,7 +1471,7 @@ - 4bytes field_size - 4bytes field_size_less_padding - */ -- s->buggy_avid = 1; -+// s->buggy_avid = 1; - // if (s->first_picture) - // printf("mjpeg: workarounding buggy AVID\n"); - s->interlace_polarity = get_bits(&s->gb, 8); -Index: libavcodec/mpegvideo.c -=================================================================== -RCS file: /cvsroot/xine/xine-lib/src/libffmpeg/libavcodec/mpegvideo.c,v -retrieving revision 1.31 -diff -u -r1.31 mpegvideo.c ---- libavcodec/mpegvideo.c 9 May 2003 23:54:05 -0000 1.31 -+++ libavcodec/mpegvideo.c 25 May 2003 18:29:52 -0000 -@@ -763,7 +763,9 @@ - if (MPV_common_init(s) < 0) - return -1; - -+#ifdef CONFIG_ENCODERS_FULL - ff_init_me(s); -+#endif - - #ifdef CONFIG_ENCODERS - #ifdef CONFIG_RISKY -@@ -1550,8 +1552,10 @@ - if (s->out_format == FMT_MJPEG) - mjpeg_picture_trailer(s); - -+#ifdef CONFIG_ENCODERS_FULL - if(s->flags&CODEC_FLAG_PASS1) - ff_write_pass1_stats(s); -+#endif - - for(i=0; i<4; i++){ - avctx->error[i] += s->current_picture_ptr->error[i]; -@@ -3137,6 +3141,7 @@ - /* Estimate motion for every MB */ - s->mb_intra=0; //for the rate distoration & bit compare functions - if(s->pict_type != I_TYPE){ -+#ifdef CONFIG_ENCODERS_FULL - if(s->pict_type != B_TYPE){ - if((s->avctx->pre_me && s->last_non_b_pict_type==I_TYPE) || s->avctx->pre_me==2){ - s->me.pre_pass=1; -@@ -3174,6 +3179,7 @@ - ff_estimate_p_frame_motion(s, mb_x, mb_y); - } - } -+#endif - }else /* if(s->pict_type == I_TYPE) */{ - /* I-Frame */ - //FIXME do we need to zero them? -@@ -3208,6 +3214,7 @@ - //printf("Scene change detected, encoding as I Frame %d %d\n", s->current_picture.mb_var_sum, s->current_picture.mc_mb_var_sum); - } - -+#ifdef CONFIG_ENCODERS_FULL - if(!s->umvplus){ - if(s->pict_type==P_TYPE || s->pict_type==S_TYPE) { - s->f_code= ff_get_best_fcode(s, s->p_mv_table, MB_TYPE_INTER); -@@ -3232,6 +3239,7 @@ - ff_fix_long_b_mvs(s, s->b_bidir_back_mv_table, s->b_code, MB_TYPE_BIDIR); - } - } -+#endif - - if (s->fixed_qscale) - s->frame_qscale = s->current_picture.quality; -Index: libavcodec/h263.c -=================================================================== -RCS file: /cvsroot/xine/xine-lib/src/libffmpeg/libavcodec/h263.c,v -retrieving revision 1.29 -diff -u -r1.29 h263.c ---- libavcodec/h263.c 19 Jun 2003 00:47:19 -0000 1.29 -+++ libavcodec/h263.c 27 Jun 2003 13:51:30 -0000 -@@ -4606,6 +4606,7 @@ - s->divx_version= ver; - s->divx_build= build; - s->divx_packed= e==3 && last=='p'; -+#if 0 - if(s->picture_number==0){ - printf("This file was encoded with DivX%d Build%d", ver, build); - if(s->divx_packed) -@@ -4613,6 +4614,7 @@ - else - printf("\n"); - } -+#endif - } - - /* ffmpeg detection */ -@@ -4628,16 +4630,20 @@ - if(e==4){ - s->ffmpeg_version= ver*256*256 + ver2*256 + ver3; - s->lavc_build= build; -+#if 0 - if(s->picture_number==0) - printf("This file was encoded with libavcodec build %d\n", build); -+#endif - } - - /* xvid detection */ - e=sscanf(buf, "XviD%d", &build); - if(e==1){ - s->xvid_build= build; -+#if 0 - if(s->picture_number==0) - printf("This file was encoded with XviD build %d\n", build); -+#endif - } - - //printf("User Data: %s\n", buf); -Index: libavcodec/i386/motion_est_mmx.c -=================================================================== -RCS file: /cvsroot/xine/xine-lib/src/libffmpeg/libavcodec/i386/motion_est_mmx.c,v -retrieving revision 1.8 -diff -u -r1.8 motion_est_mmx.c ---- libavcodec/i386/motion_est_mmx.c 26 Mar 2003 14:44:17 -0000 1.8 -+++ libavcodec/i386/motion_est_mmx.c 2 Jul 2003 14:31:19 -0000 -@@ -26,7 +26,7 @@ - 0x0002000200020002, - }; - --static __attribute__ ((aligned(8))) uint64_t bone= 0x0101010101010101LL; -+static const __attribute__ ((aligned(8))) uint64_t bone= 0x0101010101010101LL; + } + #endif - static inline void sad8_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h) - { Index: libavcodec/mlib/dsputil_mlib.c =================================================================== -RCS file: /cvsroot/xine/xine-lib/src/libffmpeg/libavcodec/mlib/dsputil_mlib.c,v ---- dsputil_mlib,c 2003-10-19 13:06:27.560738000 +0100 -+++ dsputil_mlib.c 2003-10-19 13:01:50.427851000 +0100 -@@ -414,6 +414,7 @@ +RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/mlib/dsputil_mlib.c,v +retrieving revision 1.14 +diff -u -u -r1.14 dsputil_mlib.c +--- libavcodec/mlib/dsputil_mlib.c 11 Oct 2003 16:43:51 -0000 1.14 ++++ libavcodec/mlib/dsputil_mlib.c 21 Oct 2003 12:11:42 -0000 +@@ -419,6 +419,7 @@ void dsputil_init_mlib(DSPContext* c, AVCodecContext *avctx) { @@ -705,7 +679,7 @@ c->get_pixels = get_pixels_mlib; c->diff_pixels = diff_pixels_mlib; c->add_pixels_clamped = add_pixels_clamped_mlib; -@@ -440,10 +441,12 @@ +@@ -445,10 +446,12 @@ c->put_no_rnd_pixels_tab[1][0] = put_pixels8_mlib; c->bswap_buf = bswap_buf_mlib; @@ -718,8 +692,8 @@ if(s->avctx->dct_algo==FF_DCT_AUTO || s->avctx->dct_algo==FF_DCT_MLIB){ s->dsp.fdct = ff_fdct_mlib; } -@@ -453,4 +456,5 @@ - s->dsp.idct_add = ff_idct_add_mlib; +@@ -459,4 +462,5 @@ + s->dsp.idct = ff_idct_mlib; s->dsp.idct_permutation_type= FF_NO_IDCT_PERM; } + } Index: xine_decoder.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/libffmpeg/xine_decoder.c,v retrieving revision 1.130 retrieving revision 1.131 diff -u -r1.130 -r1.131 --- xine_decoder.c 23 Oct 2003 20:12:33 -0000 1.130 +++ xine_decoder.c 27 Oct 2003 15:24:38 -0000 1.131 @@ -230,7 +230,7 @@ * first frame. setting to -1 avoid enabling DR1 for them. */ this->context->pix_fmt = -1; - + if( bih && bih->biSize > sizeof(xine_bmiheader) ) { this->context->extradata_size = bih->biSize - sizeof(xine_bmiheader); this->context->extradata = malloc(this->context->extradata_size); @@ -238,6 +238,13 @@ (uint8_t *)bih + sizeof(xine_bmiheader), this->context->extradata_size ); } + if ((this->codec->id == CODEC_ID_XAN_WC3) || + (this->codec->id == CODEC_ID_INTERPLAY_VIDEO)) { + /* dupe certain decoders by giving them an empty palette; these + * decoders do not care about the palette during initialization */ + this->context->extradata_size = sizeof(AVPaletteControl); + this->context->extradata = xine_xmalloc(this->context->extradata_size); + } if(bih) this->context->bits_per_sample = bih->biBitCount; @@ -278,7 +285,8 @@ if((this->context->pix_fmt == PIX_FMT_RGBA32) || (this->context->pix_fmt == PIX_FMT_RGB565) || - (this->context->pix_fmt == PIX_FMT_RGB555)) { + (this->context->pix_fmt == PIX_FMT_RGB555) || + (this->context->pix_fmt == PIX_FMT_PAL8)) { this->output_format = XINE_IMGFMT_YUY2; init_yuv_planes(&this->yuv, this->context->width, this->context->height); } else { @@ -643,6 +651,45 @@ yuv444_to_yuy2(&this->yuv, img->base[0], img->pitches[0]); + } else if (this->context->pix_fmt == PIX_FMT_PAL8) { + + int x, plane_ptr = 0; + uint8_t *src; + uint8_t pixel; + uint32_t *palette32 = (uint32_t *)su; /* palette is in data[1] */ + uint32_t rgb_color; + uint8_t r, g, b; + uint8_t y_palette[256]; + uint8_t u_palette[256]; + uint8_t v_palette[256]; + + for (x = 0; x < 256; x++) { + rgb_color = palette32[x]; + b = rgb_color & 0xFF; + rgb_color >>= 8; + g = rgb_color & 0xFF; + rgb_color >>= 8; + r = rgb_color & 0xFF; + y_palette[x] = COMPUTE_Y(r, g, b); + u_palette[x] = COMPUTE_U(r, g, b); + v_palette[x] = COMPUTE_V(r, g, b); + } + + for(y = 0; y < this->context->height; y++) { + src = sy; + for(x = 0; x < this->context->width; x++) { + pixel = *src++; + + this->yuv.y[plane_ptr] = y_palette[pixel]; + this->yuv.u[plane_ptr] = u_palette[pixel]; + this->yuv.v[plane_ptr] = v_palette[pixel]; + plane_ptr++; + } + sy += this->av_frame->linesize[0]; + } + + yuv444_to_yuy2(&this->yuv, img->base[0], img->pitches[0]); + } else { for (y=0; y<this->context->height; y++) { @@ -828,6 +875,56 @@ this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] = strdup ("4XM (ffmpeg)"); break; + case BUF_VIDEO_CINEPAK: + this->codec = avcodec_find_decoder (CODEC_ID_CINEPAK); + this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] + = strdup ("Cinepak (ffmpeg)"); + break; + case BUF_VIDEO_MSVC: + this->codec = avcodec_find_decoder (CODEC_ID_MSVIDEO1); + this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] + = strdup ("Microsoft Video 1 (ffmpeg)"); + break; + case BUF_VIDEO_MSRLE: + this->codec = avcodec_find_decoder (CODEC_ID_MSRLE); + this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] + = strdup ("Microsoft RLE (ffmpeg)"); + break; + case BUF_VIDEO_RPZA: + this->codec = avcodec_find_decoder (CODEC_ID_RPZA); + this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] + = strdup ("Apple Quicktime Video/RPZA (ffmpeg)"); + break; + case BUF_VIDEO_CYUV: + this->codec = avcodec_find_decoder (CODEC_ID_CYUV); + this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] + = strdup ("Creative YUV (ffmpeg)"); + break; + case BUF_VIDEO_ROQ: + this->codec = avcodec_find_decoder (CODEC_ID_ROQ); + this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] + = strdup ("Id Software RoQ (ffmpeg)"); + break; + case BUF_VIDEO_IDCIN: + this->codec = avcodec_find_decoder (CODEC_ID_IDCIN); + this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] + = strdup ("Id Software CIN (ffmpeg)"); + break; + case BUF_VIDEO_WC3: + this->codec = avcodec_find_decoder (CODEC_ID_XAN_WC3); + this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] + = strdup ("Xan (ffmpeg)"); + break; + case BUF_VIDEO_VQA: + this->codec = avcodec_find_decoder (CODEC_ID_WS_VQA); + this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] + = strdup ("Westwood Studios VQA (ffmpeg)"); + break; + case BUF_VIDEO_INTERPLAY: + this->codec = avcodec_find_decoder (CODEC_ID_INTERPLAY_VIDEO); + this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] + = strdup ("Interplay MVE (ffmpeg)"); + break; default: printf ("ffmpeg: unknown video format (buftype: 0x%08X)\n", buf->type & 0xFFFF0000); @@ -843,13 +940,45 @@ init_video_codec (this, (xine_bmiheader *)buf->content ); init_postprocess (this); - } else if ((buf->decoder_flags & BUF_FLAG_SPECIAL) && - (buf->decoder_info[1] == BUF_SPECIAL_STSD_ATOM)) { + free(this->context->extradata); + this->context->extradata = NULL; + this->context->extradata_size = 0; - this->context->extradata_size = buf->decoder_info[2]; - this->context->extradata = xine_xmalloc(buf->decoder_info[2]); - memcpy(this->context->extradata, buf->decoder_info_ptr[2], - buf->decoder_info[2]); + } else if (buf->decoder_flags & BUF_FLAG_SPECIAL) { + + /* take care of all the various types of special buffers */ + + /* first, free any previous extradata chunk */ + free(this->context->extradata); + this->context->extradata = NULL; + this->context->extradata_size = 0; + + if (buf->decoder_info[1] == BUF_SPECIAL_STSD_ATOM) { + + this->context->extradata_size = buf->decoder_info[2]; + this->context->extradata = xine_xmalloc(buf->decoder_info[2]); + memcpy(this->context->extradata, buf->decoder_info_ptr[2], + buf->decoder_info[2]); + + } else if (buf->decoder_info[1] == BUF_SPECIAL_PALETTE) { + + int i; + palette_entry_t *demuxer_palette; + AVPaletteControl *decoder_palette; + + this->context->extradata_size = sizeof(AVPaletteControl); + this->context->extradata = xine_xmalloc(this->context->extradata_size); + + decoder_palette = (AVPaletteControl *)this->context->extradata; + demuxer_palette = (palette_entry_t *)buf->decoder_info_ptr[2]; + + for (i = 0; i < buf->decoder_info[2]; i++) { + decoder_palette->palette[i * 3 + 0] = demuxer_palette[i].r; + decoder_palette->palette[i * 3 + 1] = demuxer_palette[i].g; + decoder_palette->palette[i * 3 + 2] = demuxer_palette[i].b; + } + decoder_palette->palette_changed = 1; + } } else if (this->decoder_ok) { @@ -916,7 +1045,7 @@ len = this->size; got_picture = 1; } else - len = avcodec_decode_video (this->context, this->av_frame, + len = avcodec_decode_video (this->context, this->av_frame, &got_picture, &this->buf[offset], this->size); if (len<0) { @@ -943,7 +1072,7 @@ printf ("ffmpeg: got a picture\n"); #endif - this->aspect_ratio = this->context->aspect_ratio; + this->aspect_ratio = av_q2d (this->context->sample_aspect_ratio); if(this->av_frame->type == FF_BUFFER_TYPE_USER){ img = (vo_frame_t*)this->av_frame->opaque; @@ -1079,9 +1208,9 @@ register_avcodec(&wmav1_decoder); register_avcodec(&wmav2_decoder); register_avcodec(&indeo3_decoder); - register_avcodec(&mpeg_decoder); + register_avcodec(&mpeg1video_decoder); register_avcodec(&dvvideo_decoder); - register_avcodec(&dvaudio_decoder); + register_avcodec(&pcm_s16le_decoder); register_avcodec(&mjpeg_decoder); register_avcodec(&mjpegb_decoder); register_avcodec(&mp2_decoder); @@ -1095,6 +1224,26 @@ register_avcodec(&fourxm_decoder); register_avcodec(&ra_144_decoder); register_avcodec(&ra_288_decoder); + register_avcodec(&adpcm_ms_decoder); + register_avcodec(&adpcm_ima_qt_decoder); + register_avcodec(&adpcm_ima_wav_decoder); + register_avcodec(&adpcm_ima_dk3_decoder); + register_avcodec(&adpcm_ima_dk4_decoder); + register_avcodec(&adpcm_ima_ws_decoder); + register_avcodec(&adpcm_xa_decoder); + register_avcodec(&pcm_alaw_decoder); + register_avcodec(&pcm_mulaw_decoder); + register_avcodec(&roq_dpcm_decoder); + register_avcodec(&interplay_dpcm_decoder); + register_avcodec(&cinepak_decoder); + register_avcodec(&msvideo1_decoder); + register_avcodec(&msrle_decoder); + register_avcodec(&rpza_decoder); + register_avcodec(&roq_decoder); + register_avcodec(&idcin_decoder); + register_avcodec(&xan_wc3_decoder); + register_avcodec(&vqa_decoder); + register_avcodec(&interplay_video_decoder); } static void ff_dispose (video_decoder_t *this_gen) { @@ -1120,7 +1269,8 @@ if((this->context) && ((this->context->pix_fmt == PIX_FMT_RGBA32) || (this->context->pix_fmt == PIX_FMT_RGB565) || - (this->context->pix_fmt == PIX_FMT_RGB555))) + (this->context->pix_fmt == PIX_FMT_RGB555) || + (this->context->pix_fmt == PIX_FMT_PAL8))) free_yuv_planes(&this->yuv); if( this->context ) @@ -1279,6 +1429,61 @@ this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] = strdup ("MP3 (ffmpeg)"); break; + case BUF_AUDIO_MSADPCM: + this->codec = avcodec_find_decoder (CODEC_ID_ADPCM_MS); + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] + = strdup ("MS ADPCM (ffmpeg)"); + break; + case BUF_AUDIO_QTIMAADPCM: + this->codec = avcodec_find_decoder (CODEC_ID_ADPCM_IMA_QT); + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] + = strdup ("QT IMA ADPCM (ffmpeg)"); + break; + case BUF_AUDIO_MSIMAADPCM: + this->codec = avcodec_find_decoder (CODEC_ID_ADPCM_IMA_WAV); + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] + = strdup ("MS IMA ADPCM (ffmpeg)"); + break; + case BUF_AUDIO_DK3ADPCM: + this->codec = avcodec_find_decoder (CODEC_ID_ADPCM_IMA_DK3); + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] + = strdup ("Duck DK3 ADPCM (ffmpeg)"); + break; + case BUF_AUDIO_DK4ADPCM: + this->codec = avcodec_find_decoder (CODEC_ID_ADPCM_IMA_DK4); + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] + = strdup ("Duck DK4 ADPCM (ffmpeg)"); + break; + case BUF_AUDIO_VQA_IMA: + this->codec = avcodec_find_decoder (CODEC_ID_ADPCM_IMA_WS); + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] + = strdup ("Westwood Studios IMA (ffmpeg)"); + break; + case BUF_AUDIO_XA_ADPCM: + this->codec = avcodec_find_decoder (CODEC_ID_ADPCM_XA); + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] + = strdup ("CD-ROM/XA ADPCM (ffmpeg)"); + break; + case BUF_AUDIO_MULAW: + this->codec = avcodec_find_decoder (CODEC_ID_PCM_MULAW); + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] + = strdup ("mu-law logarithmic PCM (ffmpeg)"); + break; + case BUF_AUDIO_ALAW: + this->codec = avcodec_find_decoder (CODEC_ID_PCM_ALAW); + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] + = strdup ("A-law logarithmic PCM (ffmpeg)"); + break; + case BUF_AUDIO_ROQ: + this->codec = avcodec_find_decoder (CODEC_ID_ROQ_DPCM); + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] + = strdup ("RoQ DPCM (ffmpeg)"); + break; + case BUF_AUDIO_INTERPLAY: + this->codec = avcodec_find_decoder (CODEC_ID_INTERPLAY_DPCM); + this->stream->meta_info[XINE_META_INFO_AUDIOCODEC] + = strdup ("Interplay DPCM (ffmpeg)"); + break; } if (!this->codec) { @@ -1527,8 +1732,18 @@ BUF_VIDEO_MPEG, BUF_VIDEO_DV, BUF_VIDEO_HUFFYUV, -/* BUF_VIDEO_VP31,*/ + BUF_VIDEO_VP31, BUF_VIDEO_4XM, + BUF_VIDEO_CINEPAK, + BUF_VIDEO_MSVC, + BUF_VIDEO_MSRLE, + BUF_VIDEO_RPZA, + BUF_VIDEO_CYUV, + BUF_VIDEO_ROQ, + BUF_VIDEO_IDCIN, + BUF_VIDEO_WC3, + BUF_VIDEO_VQA, + BUF_VIDEO_INTERPLAY, 0 }; @@ -1543,6 +1758,17 @@ BUF_AUDIO_DV, BUF_AUDIO_14_4, BUF_AUDIO_28_8, + BUF_AUDIO_MULAW, + BUF_AUDIO_ALAW, + BUF_AUDIO_MSADPCM, + BUF_AUDIO_QTIMAADPCM, + BUF_AUDIO_MSIMAADPCM, + BUF_AUDIO_DK3ADPCM, + BUF_AUDIO_DK4ADPCM, + BUF_AUDIO_XA_ADPCM, + BUF_AUDIO_ROQ, + BUF_AUDIO_INTERPLAY, + BUF_AUDIO_VQA_IMA, /* BUF_AUDIO_MPEG, */ 0 }; |