Videolan-Client gebaut.

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@888 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
ms
2007-09-15 11:36:05 +00:00
parent 97bfe38085
commit 24fd09e43c
12 changed files with 1121 additions and 0 deletions

View File

@@ -0,0 +1,190 @@
Submitted By: Randy McMurchy <randy_at_linuxfromscratch_dot_org>
Date: 2006-01-12
Initial Package Version: 0.4.9-pre1
Upstream Status: Applied in upstream CVS
Origin: MPlayer-1.0pre7try2 version of FFmpeg (upstream CVS)
Description: Fixes building with AMR code
diff -Naur ffmpeg-0.4.9-pre1-orig/libavcodec/Makefile ffmpeg-0.4.9-pre1/libavcodec/Makefile
--- ffmpeg-0.4.9-pre1-orig/libavcodec/Makefile 2004-06-18 13:11:15.000000000 +0000
+++ ffmpeg-0.4.9-pre1/libavcodec/Makefile 2006-01-12 18:27:33.000000000 +0000
@@ -7,7 +7,7 @@
VPATH=$(SRC_PATH)/libavcodec
# NOTE: -I.. is needed to include config.h
-CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
+CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE $(AMR_CFLAGS)
OBJS= common.o utils.o mem.o allcodecs.o \
mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\
@@ -22,14 +22,16 @@
smc.o parser.o flicvideo.o truemotion1.o vmdav.o lcl.o qtrle.o g726.o \
flac.o vp3dsp.o integer.o
+AMROBJS=
ifeq ($(AMR_NB),yes)
ifeq ($(AMR_NB_FIXED),yes)
-OBJS+= amr.o
+AMROBJS= amr.o
AMREXTRALIBS+= amr/*.o
AMRLIBS=amrlibs
CLEANAMR=cleanamr
else
-OBJS+= amr.o amr_float/sp_dec.o amr_float/sp_enc.o amr_float/interf_dec.o amr_float/interf_enc.o
+AMROBJS= amr.o
+OBJS+= amr_float/sp_dec.o amr_float/sp_enc.o amr_float/interf_dec.o amr_float/interf_enc.o
CLEANAMR=cleanamrfloat
endif
endif
@@ -43,13 +45,15 @@
endif
ifeq ($(AMR_WB),yes)
-OBJS+= amr.o amrwb_float/dec_acelp.o amrwb_float/dec_dtx.o amrwb_float/dec_gain.o \
+AMROBJS= amr.o
+OBJS+= amrwb_float/dec_acelp.o amrwb_float/dec_dtx.o amrwb_float/dec_gain.o \
amrwb_float/dec_if.o amrwb_float/dec_lpc.o amrwb_float/dec_main.o \
amrwb_float/dec_rom.o amrwb_float/dec_util.o amrwb_float/enc_acelp.o \
amrwb_float/enc_dtx.o amrwb_float/enc_gain.o amrwb_float/enc_if.o \
amrwb_float/enc_lpc.o amrwb_float/enc_main.o amrwb_float/enc_rom.o \
amrwb_float/enc_util.o amrwb_float/if_rom.o
endif
+OBJS+= $(AMROBJS)
CLEANAMRWB=cleanamrwbfloat
ASM_OBJS=
diff -Naur ffmpeg-0.4.9-pre1-orig/libavcodec/amr.c ffmpeg-0.4.9-pre1/libavcodec/amr.c
--- ffmpeg-0.4.9-pre1-orig/libavcodec/amr.c 2004-05-21 14:37:16.000000000 +0000
+++ ffmpeg-0.4.9-pre1/libavcodec/amr.c 2006-01-12 18:27:33.000000000 +0000
@@ -411,27 +411,32 @@
AMRContext *s = (AMRContext*)avctx->priv_data;
uint8_t*amrData=buf;
- int offset=0;
static short block_size[16]={ 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0 };
enum Mode dec_mode;
int packet_size;
- //printf("amr_decode_frame data_size=%i buf=0x%X buf_size=%d frameCount=%d!!\n",*data_size,buf,buf_size,s->frameCount);
+ /* av_log(NULL,AV_LOG_DEBUG,"amr_decode_frame buf=%p buf_size=%d frameCount=%d!!\n",buf,buf_size,s->frameCount); */
+
+ if(buf_size==0) {
+ /* nothing to do */
+ return 0;
+ }
- while(offset<buf_size)
- {
- dec_mode = (amrData[offset] >> 3) & 0x000F;
- packet_size = block_size[dec_mode];
+ dec_mode = (buf[0] >> 3) & 0x000F;
+ packet_size = block_size[dec_mode]+1;
+
+ if(packet_size > buf_size) {
+ av_log(avctx, AV_LOG_ERROR, "amr frame too short (%u, should be %u)\n", buf_size, packet_size);
+ return -1;
+ }
- s->frameCount++;
- //printf("offset=%d, packet_size=%d amrData= 0x%X %X %X %X\n",offset,packet_size,amrData[offset],amrData[offset+1],amrData[offset+2],amrData[offset+3]);
- /* call decoder */
- Decoder_Interface_Decode(s->decState, &amrData[offset], data+*data_size, 0);
- *data_size+=160*2;
+ s->frameCount++;
+ /* av_log(NULL,AV_LOG_DEBUG,"packet_size=%d amrData= 0x%X %X %X %X\n",packet_size,amrData[0],amrData[1],amrData[2],amrData[3]); */
+ /* call decoder */
+ Decoder_Interface_Decode(s->decState, amrData, data, 0);
+ *data_size=160*2;
- offset+=packet_size+1;
- }
- return buf_size;
+ return packet_size;
}
static int amr_nb_encode_frame(AVCodecContext *avctx,
@@ -445,6 +450,7 @@
data,
frame,
0);
+ /* av_log(NULL,AV_LOG_DEBUG,"amr_nb_encode_frame encoded %u bytes, bitrate %u, first byte was %#02x\n",written, s->enc_bitrate, frame[0] ); */
return written;
}
@@ -598,20 +604,26 @@
AMRWBContext *s = (AMRWBContext*)avctx->priv_data;
uint8_t*amrData=buf;
- int offset=0;
int mode;
int packet_size;
- while(offset<buf_size)
- {
- s->frameCount++;
- mode = (Word16)((amrData[offset] >> 3) & 0x0F);
- packet_size = block_size[mode];
- D_IF_decode( s->state, &amrData[offset], data+*data_size, _good_frame);
- *data_size+=320*2;
- offset+=packet_size;
+ if(buf_size==0) {
+ /* nothing to do */
+ return 0;
}
- return buf_size;
+
+ mode = (amrData[0] >> 3) & 0x000F;
+ packet_size = block_size[mode];
+
+ if(packet_size > buf_size) {
+ av_log(avctx, AV_LOG_ERROR, "amr frame too short (%u, should be %u)\n", buf_size, packet_size+1);
+ return -1;
+ }
+
+ s->frameCount++;
+ D_IF_decode( s->state, amrData, data, _good_frame);
+ *data_size=320*2;
+ return packet_size;
}
static int amr_wb_decode_close(AVCodecContext * avctx)
diff -Naur ffmpeg-0.4.9-pre1-orig/libavcodec/avcodec.h ffmpeg-0.4.9-pre1/libavcodec/avcodec.h
--- ffmpeg-0.4.9-pre1-orig/libavcodec/avcodec.h 2004-07-09 12:49:55.000000000 +0000
+++ ffmpeg-0.4.9-pre1/libavcodec/avcodec.h 2006-01-12 18:27:33.000000000 +0000
@@ -124,7 +124,7 @@
CODEC_ID_ADPCM_G726,
/* AMR */
- CODEC_ID_AMR_NB,
+ CODEC_ID_AMR_NB= 0x12000,
CODEC_ID_AMR_WB,
/* RealAudio codecs*/
diff -Naur ffmpeg-0.4.9-pre1-orig/libavformat/Makefile ffmpeg-0.4.9-pre1/libavformat/Makefile
--- ffmpeg-0.4.9-pre1-orig/libavformat/Makefile 2004-04-24 15:16:23.000000000 +0000
+++ ffmpeg-0.4.9-pre1/libavformat/Makefile 2006-01-12 18:27:33.000000000 +0000
@@ -23,15 +23,17 @@
OBJS+= asf-enc.o
endif
+AMROBJS=
ifeq ($(AMR_NB),yes)
-OBJS+= amr.o
+AMROBJS= amr.o
endif
ifeq ($(AMR_NB_FIXED),yes)
-OBJS+= amr.o
+AMROBJS= amr.o
endif
ifeq ($(AMR_WB),yes)
-OBJS+= amr.o
+AMROBJS= amr.o
endif
+OBJS+= $(AMROBJS)
# image formats
OBJS+= pnm.o yuv.o png.o jpeg.o gifdec.o sgi.o

View File

@@ -0,0 +1,115 @@
Submitted By: Randy McMurchy <randy_at_linuxfromscratch_dot_org>
Date: 2005-09-07
Initial Package Version: 0.4.9-pre1
Upstream Status: Some fixes unknown, the MMX fix is from upstream CVS
Origin: Frugalware Linux (frugalware.org)
http://frugalware.org/pipermail/frugalware-darcs/2005-August/003296.html
Also the MMX fix is from upstream CVS
http://www1.mplayerhq.hu/cgi-bin/cvsweb.cgi/ffmpeg/libavcodec/i386/dsputil_mmx.c.diff?r1=1.88&r2=1.89&cvsroot=FFMpeg
Description: Fixes GCC-4.0.1 build problems
diff -Naur ffmpeg-0.4.9-pre1-orig/libavcodec/ac3.h ffmpeg-0.4.9-pre1/libavcodec/ac3.h
--- ffmpeg-0.4.9-pre1-orig/libavcodec/ac3.h 2003-03-06 11:32:04.000000000 +0000
+++ ffmpeg-0.4.9-pre1/libavcodec/ac3.h 2005-09-07 18:50:35.000000000 +0000
@@ -43,6 +43,7 @@
int cplfleak, cplsleak;
} AC3BitAllocParameters;
+#if 0
extern const uint16_t ac3_freqs[3];
extern const uint16_t ac3_bitratetab[19];
extern const int16_t ac3_window[256];
@@ -52,6 +53,7 @@
extern const uint16_t dbkneetab[4];
extern const uint16_t floortab[8];
extern const uint16_t fgaintab[8];
+#endif
void ac3_common_init(void);
void ac3_parametric_bit_allocation(AC3BitAllocParameters *s, uint8_t *bap,
diff -Naur ffmpeg-0.4.9-pre1-orig/libavcodec/avcodec.h ffmpeg-0.4.9-pre1/libavcodec/avcodec.h
--- ffmpeg-0.4.9-pre1-orig/libavcodec/avcodec.h 2004-07-09 12:49:55.000000000 +0000
+++ ffmpeg-0.4.9-pre1/libavcodec/avcodec.h 2005-09-07 18:49:40.000000000 +0000
@@ -1657,6 +1657,14 @@
#define FF_OPT_MAX_DEPTH 10
} AVOption;
+struct AVOption;
+#ifdef HAVE_MMX
+extern const struct AVOption avoptions_common[3 + 5];
+#else
+extern const struct AVOption avoptions_common[3];
+#endif
+extern const struct AVOption avoptions_workaround_bug[11];
+
/**
* Parse option(s) and sets fields in passed structure
* @param strct structure where the parsed results will be written
diff -Naur ffmpeg-0.4.9-pre1-orig/libavcodec/common.h ffmpeg-0.4.9-pre1/libavcodec/common.h
--- ffmpeg-0.4.9-pre1-orig/libavcodec/common.h 2004-07-01 12:33:07.000000000 +0000
+++ ffmpeg-0.4.9-pre1/libavcodec/common.h 2005-09-07 18:49:40.000000000 +0000
@@ -62,14 +62,6 @@
#define AVOPTION_SUB(ptr) { .name = NULL, .help = (const char*)ptr }
#define AVOPTION_END() AVOPTION_SUB(NULL)
-struct AVOption;
-#ifdef HAVE_MMX
-extern const struct AVOption avoptions_common[3 + 5];
-#else
-extern const struct AVOption avoptions_common[3];
-#endif
-extern const struct AVOption avoptions_workaround_bug[11];
-
#endif /* HAVE_AV_CONFIG_H */
/* Suppress restrict if it was not defined in config.h. */
diff -Naur ffmpeg-0.4.9-pre1-orig/libavcodec/i386/dsputil_mmx.c ffmpeg-0.4.9-pre1/libavcodec/i386/dsputil_mmx.c
--- ffmpeg-0.4.9-pre1-orig/libavcodec/i386/dsputil_mmx.c 2004-06-08 02:13:44.000000000 +0000
+++ ffmpeg-0.4.9-pre1/libavcodec/i386/dsputil_mmx.c 2005-09-07 18:54:04.000000000 +0000
@@ -644,26 +644,22 @@
"punpcklwd %%mm0, %%mm1 \n\t"
"punpckhwd %%mm4, %%mm3 \n\t"
"punpckhwd %%mm0, %%mm6 \n\t"
- "movd %%mm5, %0 \n\t"
- "punpckhdq %%mm5, %%mm5 \n\t"
- "movd %%mm5, %1 \n\t"
- "movd %%mm3, %2 \n\t"
- "punpckhdq %%mm3, %%mm3 \n\t"
- "movd %%mm3, %3 \n\t"
- "movd %%mm1, %4 \n\t"
- "punpckhdq %%mm1, %%mm1 \n\t"
- "movd %%mm1, %5 \n\t"
- "movd %%mm6, %6 \n\t"
- "punpckhdq %%mm6, %%mm6 \n\t"
- "movd %%mm6, %7 \n\t"
- : "=m" (*(uint32_t*)(src + 0*stride)),
- "=m" (*(uint32_t*)(src + 1*stride)),
- "=m" (*(uint32_t*)(src + 2*stride)),
- "=m" (*(uint32_t*)(src + 3*stride)),
- "=m" (*(uint32_t*)(src + 4*stride)),
- "=m" (*(uint32_t*)(src + 5*stride)),
- "=m" (*(uint32_t*)(src + 6*stride)),
- "=m" (*(uint32_t*)(src + 7*stride))
+ "movd %%mm5, (%0) \n\t"
+ "punpckhdq %%mm5, %%mm5 \n\t"
+ "movd %%mm5, (%0,%2) \n\t"
+ "movd %%mm3, (%0,%2,2) \n\t"
+ "punpckhdq %%mm3, %%mm3 \n\t"
+ "movd %%mm3, (%0,%3) \n\t"
+ "movd %%mm1, (%1) \n\t"
+ "punpckhdq %%mm1, %%mm1 \n\t"
+ "movd %%mm1, (%1,%2) \n\t"
+ "movd %%mm6, (%1,%2,2) \n\t"
+ "punpckhdq %%mm6, %%mm6 \n\t"
+ "movd %%mm6, (%1,%3) \n\t"
+ :: "r" (src),
+ "r" (src + 4*stride),
+ "r" ((long) stride ),
+ "r" ((long)(3*stride))
);
}

View File

@@ -0,0 +1,31 @@
--- libavcodec/libpostproc/postprocess_template.orig.c 2005-05-04 00:13:55.809595776 -0400
+++ libavcodec/libpostproc/postprocess_template.c 2005-05-04 00:17:44.090891744 -0400
@@ -2646,7 +2646,7 @@
* accurate deblock filter
*/
static always_inline void RENAME(do_a_deblock)(uint8_t *src, int step, int stride, PPContext *c){
- int64_t dc_mask, eq_mask;
+ int64_t dc_mask, eq_mask, both_masks;
int64_t sums[10*8*2];
src+= step*3; // src points to begin of the 8x8 Block
//START_TIMER
@@ -2755,7 +2755,9 @@
: "%eax"
);
- if(dc_mask & eq_mask){
+ both_masks = dc_mask & eq_mask;
+
+ if (both_masks){
int offset= -8*step;
int64_t *temp_sums= sums;
@@ -2930,7 +2932,7 @@
" js 1b \n\t"
: "+r"(offset), "+r"(temp_sums)
- : "r" (step), "r"(src - offset), "m"(dc_mask & eq_mask)
+ : "r" (step), "r"(src - offset), "m"(both_masks)
);
}else
src+= step; // src points to begin of the 8x8 Block