--- ffmpeg-0.cvs20070307.orig/debian/libavcodec1d.install +++ ffmpeg-0.cvs20070307/debian/libavcodec1d.install @@ -0,0 +1 @@ +usr/lib/libavcodec.so.* --- ffmpeg-0.cvs20070307.orig/debian/libpostproc-dev.install +++ ffmpeg-0.cvs20070307/debian/libpostproc-dev.install @@ -0,0 +1,4 @@ +usr/lib/pkgconfig/libpostproc.pc +usr/include/postproc/postprocess.h +usr/lib/libpostproc.a +usr/lib/libpostproc.so --- ffmpeg-0.cvs20070307.orig/debian/libpostproc1d.install +++ ffmpeg-0.cvs20070307/debian/libpostproc1d.install @@ -0,0 +1 @@ +usr/lib/libpostproc.so.* --- ffmpeg-0.cvs20070307.orig/debian/libavutil1d.install +++ ffmpeg-0.cvs20070307/debian/libavutil1d.install @@ -0,0 +1 @@ +usr/lib/libavutil.so.* --- ffmpeg-0.cvs20070307.orig/debian/patches/series +++ ffmpeg-0.cvs20070307/debian/patches/series @@ -0,0 +1,41 @@ +005_m68k_workaround.diff +005_altivec_flags.diff +005_runtime_cpudetect.diff +006_mips_pthreads.diff +010_proper_rpath.diff +010_ffmpeg-config.diff +010_shared_library_versioning.diff +#020_mmx_intrinsics.diff +011_link_plugins.diff +013_strip_unneeded_linker_flags.diff +015_build_imgresample.diff +020_mmx_optims.diff +020_mmx_pic_code.diff +020_disable_snow_mmx_in_pic.diff +020_fix_libswscale_pic_code +040_early_altivec_detection.diff +040_only_use_maltivec_when_needed.diff +053_rm_demux_crash.diff +054_h264_mmx_chroma_mc_crash.diff +060_fix_avi_skip.diff +061_fix_resample_warnings.diff +300_c++_compliant_headers.diff +400_str_file_crash.diff +100_security_CVE-2008-4610.diff +101_security_CVE-2008-4867.diff +102_security_CVE-2009-0385.diff +CVE-2009-46XX/security-issue03.patch +CVE-2009-46XX/security-issue04.patch +CVE-2009-46XX/security-issue05.patch +CVE-2009-46XX/security-issue06.patch +CVE-2009-46XX/security-issue07.patch +CVE-2009-46XX/security-issue08.patch +CVE-2009-46XX/security-issue09.patch +CVE-2009-46XX/security-issue10.patch +CVE-2009-46XX/security-issue11.patch +CVE-2009-46XX/security-issue12.patch +CVE-2009-46XX/security-issue13.patch +CVE-2009-46XX/security-issue14.patch +CVE-2009-46XX/security-issue17.patch +CVE-2009-46XX/security-issue19.patch +CVE-2009-46XX/security-issue22.patch --- ffmpeg-0.cvs20070307.orig/debian/patches/CVE-2009-46XX/security-issue04.patch +++ ffmpeg-0.cvs20070307/debian/patches/CVE-2009-46XX/security-issue04.patch @@ -0,0 +1,29 @@ +Description: check submap indexes +Origin: backport, ffmpeg 0.5.1: r21730 + +diff -Nur ffmpeg-0.cvs20070307/libavcodec/vorbis.c ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c +--- ffmpeg-0.cvs20070307/libavcodec/vorbis.c 2007-03-07 05:17:31.000000000 -0500 ++++ ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c 2010-04-07 15:09:24.000000000 -0400 +@@ -838,9 +838,20 @@ + } + + for(j=0;jsubmaps;++j) { ++ int bits; + get_bits(gb, 8); // FIXME check? +- mapping_setup->submap_floor[j]=get_bits(gb, 8); +- mapping_setup->submap_residue[j]=get_bits(gb, 8); ++ bits=get_bits(gb, 8); ++ if (bits>=vc->floor_count) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "submap floor value %d out of range. \n", bits); ++ return -1; ++ } ++ mapping_setup->submap_floor[j]=bits; ++ bits=get_bits(gb, 8); ++ if (bits>=vc->residue_count) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "submap residue value %d out of range. \n", bits); ++ return -1; ++ } ++ mapping_setup->submap_residue[j]=bits; + + AV_DEBUG(" %d mapping %d submap : floor %d, residue %d \n", i, j, mapping_setup->submap_floor[j], mapping_setup->submap_residue[j]); + } --- ffmpeg-0.cvs20070307.orig/debian/patches/CVE-2009-46XX/security-issue05.patch +++ ffmpeg-0.cvs20070307/debian/patches/CVE-2009-46XX/security-issue05.patch @@ -0,0 +1,17 @@ +Description: check classbook value +Origin: backport, ffmpeg 0.5.1: r21725 + +diff -Nur ffmpeg-0.cvs20070307/libavcodec/vorbis.c ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c +--- ffmpeg-0.cvs20070307/libavcodec/vorbis.c 2010-04-07 15:09:43.000000000 -0400 ++++ ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c 2010-04-07 15:09:48.000000000 -0400 +@@ -751,6 +751,10 @@ + res_setup->partition_size=get_bits(gb, 24)+1; + res_setup->classifications=get_bits(gb, 6)+1; + res_setup->classbook=get_bits(gb, 8); ++ if (res_setup->classbook>=vc->codebook_count) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "classbook value %d out of range. \n", res_setup->classbook); ++ return 1; ++ } + + AV_DEBUG(" begin %d end %d part.size %d classif.s %d classbook %d \n", res_setup->begin, res_setup->end, res_setup->partition_size, + res_setup->classifications, res_setup->classbook); --- ffmpeg-0.cvs20070307.orig/debian/patches/CVE-2009-46XX/security-issue07.patch +++ ffmpeg-0.cvs20070307/debian/patches/CVE-2009-46XX/security-issue07.patch @@ -0,0 +1,32 @@ +Description: Check masterbook index and subclass book index. +Origin: backport, ffmpeg 0.5.1: r21727 + +diff -Nur ffmpeg-0.cvs20070307/libavcodec/vorbis.c ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c +--- ffmpeg-0.cvs20070307/libavcodec/vorbis.c 2010-04-07 15:10:55.000000000 -0400 ++++ ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c 2010-04-07 15:10:58.000000000 -0400 +@@ -607,13 +607,23 @@ + AV_DEBUG(" %d floor %d class dim: %d subclasses %d \n", i, j, floor_setup->data.t1.class_dimensions[j], floor_setup->data.t1.class_subclasses[j]); + + if (floor_setup->data.t1.class_subclasses[j]) { +- floor_setup->data.t1.class_masterbook[j]=get_bits(gb, 8); ++ int bits=get_bits(gb, 8); ++ if (bits>=vc->codebook_count) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "Masterbook index %d is out of range.\n", bits); ++ return 1; ++ } ++ floor_setup->data.t1.class_masterbook[j]=bits; + + AV_DEBUG(" masterbook: %d \n", floor_setup->data.t1.class_masterbook[j]); + } + + for(k=0;k<(1<data.t1.class_subclasses[j]);++k) { +- floor_setup->data.t1.subclass_books[j][k]=(int16_t)get_bits(gb, 8)-1; ++ int16_t bits=get_bits(gb, 8)-1; ++ if (bits!=-1 && bits>=vc->codebook_count) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "Subclass book index %d is out of range.\n", bits); ++ return 1; ++ } ++ floor_setup->data.t1.subclass_books[j][k]=bits; + + AV_DEBUG(" book %d. : %d \n", k, floor_setup->data.t1.subclass_books[j][k]); + } --- ffmpeg-0.cvs20070307.orig/debian/patches/CVE-2009-46XX/security-issue14.patch +++ ffmpeg-0.cvs20070307/debian/patches/CVE-2009-46XX/security-issue14.patch @@ -0,0 +1,17 @@ +Description: Check dimensions against 0 too. +Origin: backport, ffmpeg 0.5.1: r21721 + +diff -Nur ffmpeg-0.cvs20070307/libavcodec/vorbis.c ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c +--- ffmpeg-0.cvs20070307/libavcodec/vorbis.c 2010-04-07 15:11:47.000000000 -0400 ++++ ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c 2010-04-07 15:11:52.000000000 -0400 +@@ -365,8 +365,8 @@ + } + + codebook_setup->dimensions=get_bits(gb, 16); +- if (codebook_setup->dimensions>16) { +- av_log(vc->avccontext, AV_LOG_ERROR, " %"PRIdFAST16". Codebook's dimension is too large (%d). \n", cb, codebook_setup->dimensions); ++ if (codebook_setup->dimensions>16||codebook_setup->dimensions==0) { ++ av_log(vc->avccontext, AV_LOG_ERROR, " %"PRIdFAST16". Codebook's dimension is invalid (%d). \n", cb, codebook_setup->dimensions); + goto error; + } + entries=get_bits(gb, 24); --- ffmpeg-0.cvs20070307.orig/debian/patches/CVE-2009-46XX/security-issue09.patch +++ ffmpeg-0.cvs20070307/debian/patches/CVE-2009-46XX/security-issue09.patch @@ -0,0 +1,29 @@ +Description: Check begin/end/partition_size. +Origin: backport, ffmpeg 0.5.1: r21729 + +diff -Nur ffmpeg-0.cvs20070307/libavcodec/vorbis.c ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c +--- ffmpeg-0.cvs20070307/libavcodec/vorbis.c 2010-04-07 15:11:12.000000000 -0400 ++++ ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c 2010-04-07 15:11:15.000000000 -0400 +@@ -37,6 +37,7 @@ + #define V_NB_BITS 8 + #define V_NB_BITS2 11 + #define V_MAX_VLCS (1<<16) ++#define V_MAX_PARTITIONS (1<<20) + + #ifndef V_DEBUG + #define AV_DEBUG(...) +@@ -759,6 +760,14 @@ + res_setup->begin=get_bits(gb, 24); + res_setup->end=get_bits(gb, 24); + res_setup->partition_size=get_bits(gb, 24)+1; ++ /* Validations to prevent a buffer overflow later. */ ++ if (res_setup->begin>res_setup->end ++ || res_setup->end>vc->blocksize[1]/(res_setup->type==2?1:2) ++ || (res_setup->end-res_setup->begin)/res_setup->partition_size>V_MAX_PARTITIONS) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "partition out of bounds: type, begin, end, size, blocksize: %d, %d, %d, %d, %d\n", res_setup->type, res_setup->begin, res_setup->end, res_setup->partition_size, vc->blocksize[1]/2); ++ return 1; ++ } ++ + res_setup->classifications=get_bits(gb, 6)+1; + res_setup->classbook=get_bits(gb, 8); + if (res_setup->classbook>=vc->codebook_count) { --- ffmpeg-0.cvs20070307.orig/debian/patches/CVE-2009-46XX/security-issue08.patch +++ ffmpeg-0.cvs20070307/debian/patches/CVE-2009-46XX/security-issue08.patch @@ -0,0 +1,20 @@ +Description: Check res_setup->books. +Origin: backport, ffmpeg 0.5.1: r21728 + +diff -Nur ffmpeg-0.cvs20070307/libavcodec/vorbis.c ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c +--- ffmpeg-0.cvs20070307/libavcodec/vorbis.c 2010-04-07 15:11:04.000000000 -0400 ++++ ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c 2010-04-07 15:11:07.000000000 -0400 +@@ -784,7 +784,12 @@ + for(j=0;jclassifications;++j) { + for(k=0;k<8;++k) { + if (cascade[j]&(1<books[j][k]=get_bits(gb, 8); ++ int bits=get_bits(gb, 8); ++ if (bits>=vc->codebook_count) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "book value %d out of range. \n", bits); ++ return 1; ++ } ++ res_setup->books[j][k]=bits; + + AV_DEBUG(" %d class casscade depth %d book: %d \n", j, k, res_setup->books[j][k]); + --- ffmpeg-0.cvs20070307.orig/debian/patches/CVE-2009-46XX/security-issue17.patch +++ ffmpeg-0.cvs20070307/debian/patches/CVE-2009-46XX/security-issue17.patch @@ -0,0 +1,39 @@ +Description: Make sure that all memory allocations succeed. +Origin: backport, ffmpeg 0.5.1: r21720 + +diff -Nur ffmpeg-0.cvs20070307/libavcodec/vp3.c ffmpeg-0.cvs20070307.new/libavcodec/vp3.c +--- ffmpeg-0.cvs20070307/libavcodec/vp3.c 2010-04-07 15:16:07.000000000 -0400 ++++ ffmpeg-0.cvs20070307.new/libavcodec/vp3.c 2010-04-07 15:16:14.000000000 -0400 +@@ -44,6 +44,8 @@ + + #define FRAGMENT_PIXELS 8 + ++static int vp3_decode_end(AVCodecContext *avctx); ++ + /* + * Debugging Variables + * +@@ -2014,6 +2016,11 @@ + s->coeffs = av_malloc(s->fragment_count * sizeof(Coeff) * 65); + s->coded_fragment_list = av_malloc(s->fragment_count * sizeof(int)); + s->pixel_addresses_inited = 0; ++ if (!s->superblock_coding || !s->all_fragments || ++ !s->coeffs || !s->coded_fragment_list) { ++ vp3_decode_end(avctx); ++ return -1; ++ } + + if (!s->theora_tables) + { +@@ -2114,6 +2121,11 @@ + s->superblock_macroblocks = av_malloc(s->superblock_count * 4 * sizeof(int)); + s->macroblock_fragments = av_malloc(s->macroblock_count * 6 * sizeof(int)); + s->macroblock_coding = av_malloc(s->macroblock_count + 1); ++ if (!s->superblock_fragments || !s->superblock_macroblocks || ++ !s->macroblock_fragments || !s->macroblock_coding) { ++ vp3_decode_end(avctx); ++ return -1; ++ } + init_block_mapping(s); + + for (i = 0; i < 3; i++) { --- ffmpeg-0.cvs20070307.orig/debian/patches/CVE-2009-46XX/security-issue22.patch +++ ffmpeg-0.cvs20070307/debian/patches/CVE-2009-46XX/security-issue22.patch @@ -0,0 +1,46 @@ +Description: check codec_id and codec_type, make sure priv_data is freed + and codec is set to NULL +Origin: backport, ffmpeg trunk: 19973, 20002, 20125 + +diff -Nur ffmpeg-0.cvs20070307/libavcodec/utils.c ffmpeg-0.cvs20070307.new/libavcodec/utils.c +--- ffmpeg-0.cvs20070307/libavcodec/utils.c 2007-03-07 08:37:04.000000000 -0500 ++++ ffmpeg-0.cvs20070307.new/libavcodec/utils.c 2010-04-07 15:21:52.000000000 -0400 +@@ -822,23 +822,32 @@ + avcodec_set_dimensions(avctx, avctx->width, avctx->height); + + if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height)){ +- av_freep(&avctx->priv_data); +- goto end; ++ goto free_and_end; + } + + avctx->codec = codec; +- avctx->codec_id = codec->id; ++ if ((avctx->codec_type == CODEC_TYPE_UNKNOWN || avctx->codec_type == codec->type) && ++ avctx->codec_id == CODEC_ID_NONE) { ++ avctx->codec_type = codec->type; ++ avctx->codec_id = codec->id; ++ } ++ if(avctx->codec_id != codec->id || avctx->codec_type != codec->type){ ++ av_log(avctx, AV_LOG_ERROR, "codec type or id mismatches\n"); ++ goto free_and_end; ++ } + avctx->frame_number = 0; + ret = avctx->codec->init(avctx); + if (ret < 0) { +- av_freep(&avctx->priv_data); +- avctx->codec= NULL; +- goto end; ++ goto free_and_end; + } + ret=0; + end: + entangled_thread_counter--; + return ret; ++free_and_end: ++ av_freep(&avctx->priv_data); ++ avctx->codec= NULL; ++ goto end; + } + + int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, --- ffmpeg-0.cvs20070307.orig/debian/patches/CVE-2009-46XX/security-issue06.patch +++ ffmpeg-0.cvs20070307/debian/patches/CVE-2009-46XX/security-issue06.patch @@ -0,0 +1,31 @@ +Description: Add checks for per-packet mode indexes and per-header mode + mapping indexes. +Origin: backport, ffmpeg 0.5.1: r21726 + +diff -Nur ffmpeg-0.cvs20070307/libavcodec/vorbis.c ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c +--- ffmpeg-0.cvs20070307/libavcodec/vorbis.c 2010-04-07 15:09:52.000000000 -0400 ++++ ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c 2010-04-07 15:10:00.000000000 -0400 +@@ -918,7 +918,11 @@ + mode_setup->blockflag=get_bits(gb, 1); + mode_setup->windowtype=get_bits(gb, 16); //FIXME check + mode_setup->transformtype=get_bits(gb, 16); //FIXME check +- mode_setup->mapping=get_bits(gb, 8); //FIXME check ++ mode_setup->mapping=get_bits(gb, 8); ++ if (mode_setup->mapping>=vc->mapping_count) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "mode mapping value %d out of range. \n", mode_setup->mapping); ++ return 1; ++ } + + AV_DEBUG(" %d mode: blockflag %d, windowtype %d, transformtype %d, mapping %d \n", i, mode_setup->blockflag, mode_setup->windowtype, mode_setup->transformtype, mode_setup->mapping); + } +@@ -1614,6 +1618,10 @@ + } else { + mode_number=get_bits(gb, ilog(vc->mode_count-1)); + } ++ if (mode_number>=vc->mode_count) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "mode number %d out of range.\n", mode_number); ++ return -1; ++ } + vc->mode_number=mode_number; + mapping=&vc->mappings[vc->modes[mode_number].mapping]; + --- ffmpeg-0.cvs20070307.orig/debian/patches/CVE-2009-46XX/security-issue12.patch +++ ffmpeg-0.cvs20070307/debian/patches/CVE-2009-46XX/security-issue12.patch @@ -0,0 +1,22 @@ +Description: Sanity checks for magnitude and angle. +Origin: backport, ffmpeg 0.5.1: r21723 + +diff -Nur ffmpeg-0.cvs20070307/libavcodec/vorbis.c ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c +--- ffmpeg-0.cvs20070307/libavcodec/vorbis.c 2010-04-07 15:11:34.000000000 -0400 ++++ ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c 2010-04-07 15:11:37.000000000 -0400 +@@ -844,7 +844,14 @@ + for(j=0;jcoupling_steps;++j) { + mapping_setup->magnitude[j]=get_bits(gb, ilog(vc->audio_channels-1)); + mapping_setup->angle[j]=get_bits(gb, ilog(vc->audio_channels-1)); +- // FIXME: sanity checks ++ if (mapping_setup->magnitude[j]>=vc->audio_channels) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "magnitude channel %d out of range. \n", mapping_setup->magnitude[j]); ++ return 1; ++ } ++ if (mapping_setup->angle[j]>=vc->audio_channels) { ++ av_log(vc->avccontext, AV_LOG_ERROR, "angle channel %d out of range. \n", mapping_setup->angle[j]); ++ return 1; ++ } + } + } else { + mapping_setup->coupling_steps=0; --- ffmpeg-0.cvs20070307.orig/debian/patches/CVE-2009-46XX/security-issue10.patch +++ ffmpeg-0.cvs20070307/debian/patches/CVE-2009-46XX/security-issue10.patch @@ -0,0 +1,25 @@ +Description: Check validity of channels & samplerate. +Origin: backport, ffmpeg 0.5.1: r22658 + +diff -Nur ffmpeg-0.cvs20070307/libavcodec/vorbis.c ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c +--- ffmpeg-0.cvs20070307/libavcodec/vorbis.c 2010-04-07 15:11:20.000000000 -0400 ++++ ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c 2010-04-07 15:11:24.000000000 -0400 +@@ -1011,8 +1011,16 @@ + } + + vc->version=get_bits_long(gb, 32); //FIXME check 0 +- vc->audio_channels=get_bits(gb, 8); //FIXME check >0 +- vc->audio_samplerate=get_bits_long(gb, 32); //FIXME check >0 ++ vc->audio_channels=get_bits(gb, 8); ++ if(vc->audio_channels <= 0){ ++ av_log(vc->avccontext, AV_LOG_ERROR, "Invalid number of channels\n"); ++ return -1; ++ } ++ vc->audio_samplerate=get_bits_long(gb, 32); ++ if(vc->audio_samplerate <= 0){ ++ av_log(vc->avccontext, AV_LOG_ERROR, "Invalid samplerate\n"); ++ return -1; ++ } + vc->bitrate_maximum=get_bits_long(gb, 32); + vc->bitrate_nominal=get_bits_long(gb, 32); + vc->bitrate_minimum=get_bits_long(gb, 32); --- ffmpeg-0.cvs20070307.orig/debian/patches/CVE-2009-46XX/security-issue19.patch +++ ffmpeg-0.cvs20070307/debian/patches/CVE-2009-46XX/security-issue19.patch @@ -0,0 +1,15 @@ +Description: Set data_size to 0 to avoid having it uninitialized. +Origin: upstream, ffmpeg 0.5.1: r21718 + +diff -Nur ffmpeg-0.cvs20070307/libavcodec/mpegaudiodec.c ffmpeg-0.cvs20070307.new/libavcodec/mpegaudiodec.c +--- ffmpeg-0.cvs20070307/libavcodec/mpegaudiodec.c 2007-03-07 08:37:03.000000000 -0500 ++++ ffmpeg-0.cvs20070307.new/libavcodec/mpegaudiodec.c 2010-04-07 15:18:29.000000000 -0400 +@@ -2587,6 +2587,8 @@ + break; + } + ++ *data_size = 0; ++ + if(s->frame_size<=0 || s->frame_size > buf_size){ + av_log(avctx, AV_LOG_ERROR, "incomplete frame\n"); + return -1; --- ffmpeg-0.cvs20070307.orig/debian/patches/CVE-2009-46XX/security-issue11.patch +++ ffmpeg-0.cvs20070307/debian/patches/CVE-2009-46XX/security-issue11.patch @@ -0,0 +1,21 @@ +Description: Fix book_idx check. +Origin: backport, ffmpeg 0.5.1: r21724 + +diff -Nur ffmpeg-0.cvs20070307/libavcodec/vorbis.c ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c +--- ffmpeg-0.cvs20070307/libavcodec/vorbis.c 2010-04-07 15:11:27.000000000 -0400 ++++ ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c 2010-04-07 15:11:30.000000000 -0400 +@@ -684,12 +684,11 @@ + uint_fast8_t book_idx; + for (idx=0;idxdata.t0.num_books;++idx) { + book_idx=get_bits(gb, 8); ++ if (book_idx>=vc->codebook_count) ++ return 1; + floor_setup->data.t0.book_list[idx]=book_idx; + if (vc->codebooks[book_idx].dimensions > max_codebook_dim) + max_codebook_dim=vc->codebooks[book_idx].dimensions; +- +- if (floor_setup->data.t0.book_list[idx]>vc->codebook_count) +- return 1; + } + } + --- ffmpeg-0.cvs20070307.orig/debian/patches/CVE-2009-46XX/security-issue03.patch +++ ffmpeg-0.cvs20070307/debian/patches/CVE-2009-46XX/security-issue03.patch @@ -0,0 +1,281 @@ +Description: check stream existence before assignment +Origin: backport, ffmpeg 0.5: r21709 +Origin: backport, ffmpeg 0.5: r21710 + +diff -Nur ffmpeg-0.cvs20070307/libavformat/mov.c ffmpeg-0.cvs20070307.new/libavformat/mov.c +--- ffmpeg-0.cvs20070307/libavformat/mov.c 2007-03-07 08:37:06.000000000 -0500 ++++ ffmpeg-0.cvs20070307.new/libavformat/mov.c 2010-04-07 15:00:41.000000000 -0400 +@@ -300,10 +300,14 @@ + + static int mov_read_hdlr(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; ++ AVStream *st; + uint32_t type; + uint32_t ctype; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ + get_byte(pb); /* version */ + get_byte(pb); get_byte(pb); get_byte(pb); /* flags */ + +@@ -360,10 +364,15 @@ + + static int mov_read_esds(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- MOVStreamContext *sc = (MOVStreamContext *)st->priv_data; ++ AVStream *st; ++ MOVStreamContext *sc; + int tag, len; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ sc = (MOVStreamContext *)st->priv_data; ++ + /* Well, broken but suffisant for some MP4 streams */ + get_be32(pb); /* version + flags */ + len = mov_mp4_read_descr(pb, &tag); +@@ -446,11 +455,17 @@ + + static int mov_read_mdhd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- MOVStreamContext *sc = (MOVStreamContext *)st->priv_data; +- int version = get_byte(pb); ++ AVStream *st; ++ MOVStreamContext *sc; ++ int version; + int lang; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ sc = (MOVStreamContext *)st->priv_data; ++ ++ version = get_byte(pb); + if (version > 1) + return 1; /* unsupported */ + +@@ -513,7 +528,11 @@ + + static int mov_read_smi(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; ++ AVStream *st; ++ ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; + + if((uint64_t)atom.size > (1<<30)) + return -1; +@@ -536,9 +555,14 @@ + + static int mov_read_enda(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- int little_endian = get_be16(pb); +- ++ AVStream *st; ++ int little_endian; ++ ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ ++ little_endian = get_be16(pb); + if (little_endian) { + switch (st->codec->codec_id) { + case CODEC_ID_PCM_S24BE: +@@ -557,7 +581,12 @@ + /* FIXME modify qdm2/svq3/h264 decoders to take full atom as extradata */ + static int mov_read_extradata(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; ++ AVStream *st; ++ ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ + if((uint64_t)atom.size > (1<<30)) + return -1; + av_free(st->codec->extradata); +@@ -573,7 +602,11 @@ + + static int mov_read_wave(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; ++ AVStream *st; ++ ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; + + if((uint64_t)atom.size > (1<<30)) + return -1; +@@ -597,7 +630,11 @@ + + static int mov_read_avcC(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; ++ AVStream *st; ++ ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; + + if((uint64_t)atom.size > (1<<30)) + return -1; +@@ -617,10 +654,15 @@ + + static int mov_read_stco(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- MOVStreamContext *sc = (MOVStreamContext *)st->priv_data; ++ AVStream *st; ++ MOVStreamContext *sc; + unsigned int i, entries; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ sc = (MOVStreamContext *)st->priv_data; ++ + get_byte(pb); /* version */ + get_byte(pb); get_byte(pb); get_byte(pb); /* flags */ + +@@ -649,8 +691,8 @@ + + static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- MOVStreamContext *sc = (MOVStreamContext *)st->priv_data; ++ AVStream *st; ++ MOVStreamContext *sc; + int entries, frames_per_sample; + uint32_t format; + uint8_t codec_name[32]; +@@ -667,6 +709,11 @@ + int j; + unsigned char r, g, b; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ sc = (MOVStreamContext *)st->priv_data; ++ + get_byte(pb); /* version */ + get_byte(pb); get_byte(pb); get_byte(pb); /* flags */ + +@@ -937,10 +984,15 @@ + + static int mov_read_stsc(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- MOVStreamContext *sc = (MOVStreamContext *)st->priv_data; ++ AVStream *st; ++ MOVStreamContext *sc; + unsigned int i, entries; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ sc = (MOVStreamContext *)st->priv_data; ++ + get_byte(pb); /* version */ + get_byte(pb); get_byte(pb); get_byte(pb); /* flags */ + +@@ -966,10 +1018,15 @@ + + static int mov_read_stss(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- MOVStreamContext *sc = (MOVStreamContext *)st->priv_data; ++ AVStream *st; ++ MOVStreamContext *sc; + unsigned int i, entries; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ sc = (MOVStreamContext *)st->priv_data; ++ + get_byte(pb); /* version */ + get_byte(pb); get_byte(pb); get_byte(pb); /* flags */ + +@@ -996,10 +1053,15 @@ + + static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- MOVStreamContext *sc = (MOVStreamContext *)st->priv_data; ++ AVStream *st; ++ MOVStreamContext *sc; + unsigned int i, entries, sample_size; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ sc = (MOVStreamContext *)st->priv_data; ++ + get_byte(pb); /* version */ + get_byte(pb); get_byte(pb); get_byte(pb); /* flags */ + +@@ -1031,12 +1093,17 @@ + + static int mov_read_stts(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- MOVStreamContext *sc = (MOVStreamContext *)st->priv_data; ++ AVStream *st; ++ MOVStreamContext *sc; + unsigned int i, entries; + int64_t duration=0; + int64_t total_sample_count=0; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ sc = (MOVStreamContext *)st->priv_data; ++ + get_byte(pb); /* version */ + get_byte(pb); get_byte(pb); get_byte(pb); /* flags */ + entries = get_be32(pb); +@@ -1077,10 +1144,15 @@ + + static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; +- MOVStreamContext *sc = (MOVStreamContext *)st->priv_data; ++ AVStream *st; ++ MOVStreamContext *sc; + unsigned int i, entries; + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ sc = (MOVStreamContext *)st->priv_data; ++ + get_byte(pb); /* version */ + get_byte(pb); get_byte(pb); get_byte(pb); /* flags */ + entries = get_be32(pb); +@@ -1133,9 +1205,13 @@ + + static int mov_read_tkhd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) + { +- AVStream *st = c->fc->streams[c->fc->nb_streams-1]; ++ AVStream *st; + int version = get_byte(pb); + ++ if (c->fc->nb_streams < 1) ++ return 0; ++ st = c->fc->streams[c->fc->nb_streams-1]; ++ + get_byte(pb); get_byte(pb); + get_byte(pb); /* flags */ + /* --- ffmpeg-0.cvs20070307.orig/debian/patches/CVE-2009-46XX/security-issue13.patch +++ ffmpeg-0.cvs20070307/debian/patches/CVE-2009-46XX/security-issue13.patch @@ -0,0 +1,15 @@ +Description: fix = -> == typo. +Origin: backport, ffmpeg 0.5.1: r21722 + +diff -Nur ffmpeg-0.cvs20070307/libavcodec/vorbis.c ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c +--- ffmpeg-0.cvs20070307/libavcodec/vorbis.c 2010-04-07 15:11:40.000000000 -0400 ++++ ffmpeg-0.cvs20070307.new/libavcodec/vorbis.c 2010-04-07 15:11:43.000000000 -0400 +@@ -1704,7 +1704,7 @@ + uint_fast8_t ch=0; + + for(j=0;jaudio_channels;++j) { +- if ((mapping->submaps==1) || (i=mapping->mux[j])) { ++ if ((mapping->submaps==1) || (i==mapping->mux[j])) { + res_chan[j]=res_num; + if (no_residue[j]) { + do_not_decode[ch]=1; --- ffmpeg-0.cvs20070307.orig/debian/patches/020_fix_libswscale_pic_code +++ ffmpeg-0.cvs20070307/debian/patches/020_fix_libswscale_pic_code @@ -0,0 +1,22 @@ +Index: ffmpeg.feisty/libswscale/swscale.c +=================================================================== +--- ffmpeg.feisty.orig/libswscale/swscale.c 2007-03-16 17:40:54.000000000 +0100 ++++ ffmpeg.feisty/libswscale/swscale.c 2007-03-16 17:58:05.000000000 +0100 +@@ -1289,7 +1289,7 @@ + return 0; + } + +-#ifdef COMPILE_MMX2 ++#if defined (COMPILE_MMX2) && !defined(ARCH_X86_64) + static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *filter, int32_t *filterPos, int numSplits) + { + uint8_t *fragmentA; +@@ -2200,7 +2200,7 @@ + srcFilter->chrH, dstFilter->chrH, c->param); + + #define MAX_FUNNY_CODE_SIZE 10000 +-#if defined(COMPILE_MMX2) ++#if defined (COMPILE_MMX2) && !defined(ARCH_X86_64) + // can't downscale !!! + if(c->canMMX2BeUsed && (flags & SWS_FAST_BILINEAR)) + { --- ffmpeg-0.cvs20070307.orig/debian/patches/013_strip_unneeded_linker_flags.diff +++ ffmpeg-0.cvs20070307/debian/patches/013_strip_unneeded_linker_flags.diff @@ -0,0 +1,20 @@ +Index: ffmpeg-0.cvs20070307/configure +=================================================================== +--- ffmpeg-0.cvs20070307.orig/configure 2007-03-09 17:23:30.000000000 +0100 ++++ ffmpeg-0.cvs20070307/configure 2007-03-09 17:25:58.000000000 +0100 +@@ -2103,11 +2103,11 @@ + pkgconfig_generate libavutil "FFmpeg utility library" "$lavu_version" -lavutil "" ffmpeg + pkgconfig_generate_uninstalled libavutil "FFmpeg utility library" "$lavu_version" + +-pkgconfig_generate libavcodec "FFmpeg codec library" "$lavc_version" "-lavcodec $extralibs" "$pkg_requires libavutil = $lavu_version" ffmpeg +-pkgconfig_generate_uninstalled libavcodec "FFmpeg codec library" "$lavc_version" "$extralibs" "$pkg_requires libavutil = $lavu_version" ++pkgconfig_generate libavcodec "FFmpeg codec library" "$lavc_version" "-lavcodec" "$pkg_requires libavutil = $lavu_version" ffmpeg ++pkgconfig_generate_uninstalled libavcodec "FFmpeg codec library" "$lavc_version" "" "$pkg_requires libavutil = $lavu_version" + +-pkgconfig_generate libavformat "FFmpeg container format library" "$lavf_version" "-lavformat $extralibs" "$pkg_requires libavcodec = $lavc_version" ffmpeg +-pkgconfig_generate_uninstalled libavformat "FFmpeg container format library" "$lavf_version" "$extralibs" "$pkg_requires libavcodec = $lavc_version" ++pkgconfig_generate libavformat "FFmpeg container format library" "$lavf_version" "-lavformat" "$pkg_requires libavcodec = $lavc_version" ffmpeg ++pkgconfig_generate_uninstalled libavformat "FFmpeg container format library" "$lavf_version" "" "$pkg_requires libavcodec = $lavc_version" + + if enabled pp; then + pkgconfig_generate libpostproc "FFmpeg post processing library" "$pp_version" -lpostproc "" postproc --- ffmpeg-0.cvs20070307.orig/debian/patches/005_altivec_flags.diff +++ ffmpeg-0.cvs20070307/debian/patches/005_altivec_flags.diff @@ -0,0 +1,13 @@ +Index: ffmpeg.svn/configure +=================================================================== +--- ffmpeg.svn.orig/configure 2007-03-05 20:57:28.000000000 +0100 ++++ ffmpeg.svn/configure 2007-03-05 20:57:34.000000000 +0100 +@@ -1446,7 +1446,7 @@ + if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then + add_cflags "-faltivec" + else +- add_cflags "-maltivec -mabi=altivec" ++ add_cflags "-maltivec" + fi + fi + fi --- ffmpeg-0.cvs20070307.orig/debian/patches/020_disable_snow_mmx_in_pic.diff +++ ffmpeg-0.cvs20070307/debian/patches/020_disable_snow_mmx_in_pic.diff @@ -0,0 +1,30 @@ +Index: ffmpeg-0.cvs20060724/libavcodec/i386/dsputil_mmx.c +=================================================================== +--- ffmpeg-0.cvs20060724.orig/libavcodec/i386/dsputil_mmx.c 2006-07-24 17:22:05.000000000 +0200 ++++ ffmpeg-0.cvs20060724/libavcodec/i386/dsputil_mmx.c 2006-07-24 17:22:11.000000000 +0200 +@@ -3095,7 +3095,7 @@ + c->avg_h264_chroma_pixels_tab[1]= avg_h264_chroma_mc4_3dnow; + } + +-#ifdef CONFIG_SNOW_DECODER ++#if defined(CONFIG_SNOW_DECODER) && (defined(ARCH_X86_64) || !defined(PIC)) + if(mm_flags & MM_SSE2){ + c->horizontal_compose97i = ff_snow_horizontal_compose97i_sse2; + c->vertical_compose97i = ff_snow_vertical_compose97i_sse2; +Index: ffmpeg-0.cvs20060724/libavcodec/i386/snowdsp_mmx.c +=================================================================== +--- ffmpeg-0.cvs20060724.orig/libavcodec/i386/snowdsp_mmx.c 2006-07-24 17:11:17.000000000 +0200 ++++ ffmpeg-0.cvs20060724/libavcodec/i386/snowdsp_mmx.c 2006-07-24 17:22:11.000000000 +0200 +@@ -21,6 +21,7 @@ + #include "../snow.h" + #include "x86_cpu.h" + ++#if defined(ARCH_X86_64) || !defined(PIC) + void ff_snow_horizontal_compose97i_sse2(DWTELEM *b, int width){ + const int w2= (width+1)>>1; + // SSE2 code runs faster with pointers aligned on a 32-byte boundary. +@@ -915,3 +916,4 @@ + else + ff_snow_inner_add_yblock(obmc, obmc_stride, block, b_w, b_h, src_x,src_y, src_stride, sb, add, dst8); + } ++#endif --- ffmpeg-0.cvs20070307.orig/debian/patches/054_h264_mmx_chroma_mc_crash.diff +++ ffmpeg-0.cvs20070307/debian/patches/054_h264_mmx_chroma_mc_crash.diff @@ -0,0 +1,15 @@ +Index: ffmpeg-0.cvs20060823/libavcodec/h264.c +=================================================================== +--- ffmpeg-0.cvs20060823.orig/libavcodec/h264.c 2007-03-26 14:33:03.000000000 +0200 ++++ ffmpeg-0.cvs20060823/libavcodec/h264.c 2007-03-26 14:33:12.000000000 +0200 +@@ -2890,8 +2890,8 @@ + + if( full_mx < 0-extra_width + || full_my < 0-extra_height +- || full_mx + 16/*FIXME*/ > pic_width + extra_width +- || full_my + 16/*FIXME*/ > pic_height + extra_height){ ++ || full_mx + 18/*FIXME*/ > pic_width + extra_width ++ || full_my + 18/*FIXME*/ > pic_height + extra_height){ + ff_emulated_edge_mc(s->edge_emu_buffer, src_y - 2 - 2*h->mb_linesize, h->mb_linesize, 16+5, 16+5/*FIXME*/, full_mx-2, full_my-2, pic_width, pic_height); + src_y= s->edge_emu_buffer + 2 + 2*h->mb_linesize; + emu=1; --- ffmpeg-0.cvs20070307.orig/debian/patches/010_ffmpeg-config.diff +++ ffmpeg-0.cvs20070307/debian/patches/010_ffmpeg-config.diff @@ -0,0 +1,154 @@ +Index: ubuntu/ffmpeg-config.in +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ ubuntu/ffmpeg-config.in 2007-06-03 18:20:20.000000000 +0200 +@@ -0,0 +1,92 @@ ++#!/bin/sh ++ ++# ffmpeg-config ++ ++prefix="/usr" ++exec_prefix="/usr/bin" ++version="@VERSION@" ++ ++include_dir="/usr/include/ffmpeg" ++lib_dir="/usr/lib" ++ ++link_libs="" ++ ++usage() ++{ ++ cat <&2 ++fi ++ ++while test $# -gt 0; do ++ case $1 in ++ --prefix) ++ echo_prefix=yes ++ ;; ++ ++ --cflags) ++ echo_cflags=yes ++ ;; ++ ++ --libs | --plugin-libs) ++ echo_libs=yes ++ ;; ++ ++ --version) ++ echo_version=yes ++ ;; ++ ++ avcodec|avformat|postproc) ++ if test "$echo_libs" = "yes"; then ++ link_libs="$link_libs -l$1" ++ if test "$1" != "avcodec"; then ++ link_libs="$link_libs -lavcodec" ++ fi ++ link_libs="$link_libs -lavutil" ++ else ++ usage 1 1>&2 ++ fi ++ ;; ++ ++ *) ++ usage 1 1>&2 ++ ;; ++ esac ++ shift ++done ++ ++if test "$echo_prefix" = "yes"; then ++ echo $prefix ++fi ++ ++cflags="-I$include_dir" ++link_libs="$link_libs -lvorbis -lvorbisenc -ltheora -logg @FIREWIRELIBS@ -lgsm -lz -lm" ++ ++if test "$lib_dir" != "/usr/lib"; then ++ libs="-L$lib_dir" ++else ++ libs="" ++fi ++ ++if test "$echo_cflags" = "yes"; then ++ echo $cflags ++fi ++ ++if test "$echo_libs" = "yes"; then ++ echo $libs $link_libs ++fi ++ ++if test "$echo_version" = "yes"; then ++ echo $version ++fi +Index: ubuntu/ffmpeg-config.1 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ ubuntu/ffmpeg-config.1 2007-06-03 18:19:57.000000000 +0200 +@@ -0,0 +1,52 @@ ++.TH ffmpeg-config 1 "2004-07-16" "ffmpeg" ++.SH NAME ++ffmpeg-config \- script to get information about the installed version of ffmpeg ++.SH SYNOPSIS ++.B ffmpeg-config ++[ --prefix= ++.IR DIR ] ++[ --version ] [ --libs []] [ --plugin-libs []] [ --cflags ] ++.SH DESCRIPTION ++.B ffmpeg-config ++is a tool that is used to configure and determine the compiler and linker ++flags that should be used to compile and link progams, libraries, and ++plugins that use ffmpeg. ++.SH OPTIONS ++.TP ++.B --cflags ++Print the C compiler flags that are necessary to compile a program or library ++that uses ffmpeg. ++.TP ++.B --libs { avcodec | avformat | postproc } ++Print the linker flags that are necessary to link a program that uses ++libavcodec, libavformat or libpostproc. ++.TP ++.B --plugin-libs { avcodec | avformat | postproc } ++Print the linker flags that are necessary to link a shared object (such as a ++plugin for a program) that uses libavcodec, libavformat or libpostproc. ++.TP ++.BI --prefix= DIR ++If specified, use PREFIX instead of the installation prefix that ffmpeg ++was built with when computing the output for the --cflags, --libs and ++--plugin-libs options. This option must be specified before any of the ++--cflags, --libs and --plugin-libs options. ++.TP ++.B --version ++Prints the currently installed version of ffmpeg on standard output. ++.SH EXAMPLES ++.TP ++gcc -c main.c $(ffmpeg-config --cflags) -o main.o ++is how you might use ++.B ffmpeg-config ++to compile a C source file for an executable program. ++.TP ++gcc main.o util.o $(ffmpeg-config --libs avcodec) -o my_app ++is how you might use ++.B ffmpeg-config ++to link compiled objects into an executable program that uses libavcodec. ++Always make sure to mention libraries in the command line after objects ++referring to them. ++.SH AUTHOR ++This manual page was written for sdl-config by Branden Robinson, originally ++for Progeny Linux Systems, Inc., and the Debian Project. It was adapted to ++ffmpeg by Sam Hocevar. --- ffmpeg-0.cvs20070307.orig/debian/patches/040_early_altivec_detection.diff +++ ffmpeg-0.cvs20070307/debian/patches/040_early_altivec_detection.diff @@ -0,0 +1,55 @@ +Index: ffmpeg-0.cvs20070307/libavcodec/ppc/dsputil_altivec.c +=================================================================== +--- ffmpeg-0.cvs20070307.orig/libavcodec/ppc/dsputil_altivec.c 2007-03-07 11:17:31.000000000 +0100 ++++ ffmpeg-0.cvs20070307/libavcodec/ppc/dsputil_altivec.c 2007-03-07 15:04:26.000000000 +0100 +@@ -1419,7 +1419,7 @@ + return score; + } + +-int has_altivec(void) ++static int has_altivec_inner(void) + { + #ifdef __AMIGAOS4__ + ULONG result = 0; +@@ -1463,6 +1463,15 @@ + #endif /* __AMIGAOS4__ */ + } + ++int has_altivec(void) ++{ ++ static int has_it = -1; ++ if (has_it < 0) { ++ has_it = has_altivec_inner(); ++ } ++ return has_it; ++} ++ + static void vorbis_inverse_coupling_altivec(float *mag, float *ang, + int blocksize) + { +Index: ffmpeg-0.cvs20070307/libavcodec/dsputil.c +=================================================================== +--- ffmpeg-0.cvs20070307.orig/libavcodec/dsputil.c 2007-03-07 14:37:04.000000000 +0100 ++++ ffmpeg-0.cvs20070307/libavcodec/dsputil.c 2007-03-07 15:05:47.000000000 +0100 +@@ -34,6 +34,11 @@ + #include "faandct.h" + #include "snow.h" + ++/* For PPC Use */ ++#if HAVE_ALTIVEC==1 ++extern int has_altivec(void); ++#endif ++ + /* snow.c */ + void ff_spatial_dwt(int *buffer, int width, int height, int stride, int type, int decomposition_count); + +@@ -3793,6 +3798,9 @@ + { + int i; + ++#if HAVE_ALTIVEC==1 ++ (void)has_altivec(); ++#endif + for(i=0;i<256;i++) ff_cropTbl[i + MAX_NEG_CROP] = i; + for(i=0;i /* size_t */ + ++#if !defined INT64_C ++#if defined __WORDSIZE && __WORDSIZE == 64 ++#define INT64_C(c) c ## L ++#else ++#define INT64_C(c) c ## LL ++#endif ++#endif ++ + #define AV_STRINGIFY(s) AV_TOSTRING(s) + #define AV_TOSTRING(s) #s + --- ffmpeg-0.cvs20070307.orig/debian/patches/400_str_file_crash.diff +++ ffmpeg-0.cvs20070307/debian/patches/400_str_file_crash.diff @@ -0,0 +1,54 @@ +Index: ffmpeg-0.cvs20070307/libavformat/psxstr.c +=================================================================== +--- ffmpeg-0.cvs20070307.orig/libavformat/psxstr.c 2008-07-23 13:33:15.000000000 -0700 ++++ ffmpeg-0.cvs20070307/libavformat/psxstr.c 2008-07-23 13:33:23.000000000 -0700 +@@ -276,12 +276,23 @@ + int current_sector = AV_RL16(§or[0x1C]); + int sector_count = AV_RL16(§or[0x1E]); + int frame_size = AV_RL32(§or[0x24]); +- int bytes_to_copy; ++ ++ if(!( frame_size>=0 ++ && current_sector < sector_count ++ && sector_count*VIDEO_DATA_CHUNK_SIZE >=frame_size)){ ++ av_log(s, AV_LOG_ERROR, "Invalid parameters %d %d %d\n", current_sector, sector_count, frame_size); ++ return AVERROR_INVALIDDATA; ++ } ++ + // printf("%d %d %d\n",current_sector,sector_count,frame_size); + /* if this is the first sector of the frame, allocate a pkt */ + pkt = &str->tmp_pkt; +- if (current_sector == 0) { +- if (av_new_packet(pkt, frame_size)) ++ ++ if(pkt->size != sector_count*VIDEO_DATA_CHUNK_SIZE){ ++ if(pkt->data) ++ av_log(s, AV_LOG_ERROR, "missmatching sector_count\n"); ++ av_free_packet(pkt); ++ if (av_new_packet(pkt, sector_count*VIDEO_DATA_CHUNK_SIZE)) + return AVERROR_IO; + + pkt->pos= url_ftell(pb) - RAW_CD_SECTOR_SIZE; +@@ -295,15 +306,15 @@ + str->pts += (90000 / 15); + } + +- /* load all the constituent chunks in the video packet */ +- bytes_to_copy = frame_size - current_sector*VIDEO_DATA_CHUNK_SIZE; +- if (bytes_to_copy>0) { +- if (bytes_to_copy>VIDEO_DATA_CHUNK_SIZE) bytes_to_copy=VIDEO_DATA_CHUNK_SIZE; +- memcpy(pkt->data + current_sector*VIDEO_DATA_CHUNK_SIZE, +- sector + VIDEO_DATA_HEADER_SIZE, bytes_to_copy); +- } ++ memcpy(pkt->data + current_sector*VIDEO_DATA_CHUNK_SIZE, ++ sector + VIDEO_DATA_HEADER_SIZE, ++ VIDEO_DATA_CHUNK_SIZE); ++ + if (current_sector == sector_count-1) { ++ pkt->size= frame_size; + *ret_pkt = *pkt; ++ pkt->data= NULL; ++ pkt->size= -1; + return 0; + } + --- ffmpeg-0.cvs20070307.orig/debian/patches/015_build_imgresample.diff +++ ffmpeg-0.cvs20070307/debian/patches/015_build_imgresample.diff @@ -0,0 +1,46 @@ +Index: ffmpeg-0.cvs20070307/libavcodec/Makefile +=================================================================== +--- ffmpeg-0.cvs20070307.orig/libavcodec/Makefile 2007-03-07 14:37:04.000000000 +0100 ++++ ffmpeg-0.cvs20070307/libavcodec/Makefile 2007-03-28 16:54:03.000000000 +0200 +@@ -310,9 +310,7 @@ + + OBJS-$(HAVE_XVMC_ACCEL) += xvmcvideo.o + +-ifneq ($(CONFIG_SWSCALER),yes) + OBJS += imgresample.o +-endif + + # i386 mmx specific stuff + ifeq ($(TARGET_MMX),yes) +Index: ffmpeg-0.cvs20070307/tests/Makefile +=================================================================== +--- ffmpeg-0.cvs20070307.orig/tests/Makefile 2007-03-07 14:37:04.000000000 +0100 ++++ ffmpeg-0.cvs20070307/tests/Makefile 2007-03-28 16:18:43.000000000 +0200 +@@ -43,14 +43,6 @@ + @echo + endif + +-ifeq ($(CONFIG_SWSCALER),yes) +-test-server codectest mpeg4 mpeg ac3 snow snowll libavtest: swscale_error +-swscale_error: +- @echo +- @echo "This regression test is incompatible with --enable-swscaler." +- @echo +- @exit 1 +-endif + + seektest: seek_test$(EXESUF) + @$(SRC_DIR)/seek_test.sh $(SEEK_REFFILE) +Index: ffmpeg-0.cvs20070307/libavcodec/imgconvert.c +=================================================================== +--- ffmpeg-0.cvs20070307.orig/libavcodec/imgconvert.c 2007-03-28 16:54:10.000000000 +0200 ++++ ffmpeg-0.cvs20070307/libavcodec/imgconvert.c 2007-03-28 16:54:20.000000000 +0200 +@@ -2317,7 +2317,7 @@ + } + #endif + +-#ifndef CONFIG_SWSCALER ++#if 1 + /* 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, --- ffmpeg-0.cvs20070307.orig/debian/patches/100_security_CVE-2008-4610.diff +++ ffmpeg-0.cvs20070307/debian/patches/100_security_CVE-2008-4610.diff @@ -0,0 +1,45 @@ +# +# Description: fix denial of service via a malformed Ogg Media (OGM) file +# Patch: http://patch-tracking.debian.net/patch/series/view/ffmpeg-debian/0.svn20080206-17/050_CVE-2008-4610.patch +# +diff -Nur ffmpeg-0.cvs20070307/libavcodec/vp3.c ffmpeg-0.cvs20070307.new/libavcodec/vp3.c +--- ffmpeg-0.cvs20070307/libavcodec/vp3.c 2007-03-07 08:37:03.000000000 -0500 ++++ ffmpeg-0.cvs20070307.new/libavcodec/vp3.c 2009-03-13 12:38:20.000000000 -0400 +@@ -2380,9 +2380,11 @@ + } + s->huff_code_size++; + s->hbits <<= 1; +- read_huffman_tree(avctx, gb); ++ if (read_huffman_tree(avctx, gb)) ++ return -1; + s->hbits |= 1; +- read_huffman_tree(avctx, gb); ++ if (read_huffman_tree(avctx, gb)) ++ return -1; + s->hbits >>= 1; + s->huff_code_size--; + } +@@ -2558,9 +2560,11 @@ + s->huff_code_size = 1; + if (!get_bits(gb, 1)) { + s->hbits = 0; +- read_huffman_tree(avctx, gb); ++ if(read_huffman_tree(avctx, gb)) ++ return -1; + s->hbits = 1; +- read_huffman_tree(avctx, gb); ++ if(read_huffman_tree(avctx, gb)) ++ return -1; + } + } + +@@ -2614,7 +2618,8 @@ + // theora_decode_comments(avctx, gb); + break; + case 0x82: +- theora_decode_tables(avctx, &gb); ++ if (theora_decode_tables(avctx, &gb)) ++ return -1; + break; + default: + av_log(avctx, AV_LOG_ERROR, "Unknown Theora config packet: %d\n", ptype&~0x80); --- ffmpeg-0.cvs20070307.orig/debian/patches/020_mmx_intrinsics.diff +++ ffmpeg-0.cvs20070307/debian/patches/020_mmx_intrinsics.diff @@ -0,0 +1,75 @@ +Index: ffmpeg-0.cvs20060724/libavcodec/Makefile +=================================================================== +--- ffmpeg-0.cvs20060724.orig/libavcodec/Makefile 2006-07-24 17:11:20.000000000 +0200 ++++ ffmpeg-0.cvs20060724/libavcodec/Makefile 2006-07-24 17:22:05.000000000 +0200 +@@ -285,6 +285,8 @@ + i386/idct_mmx.o i386/motion_est_mmx.o \ + i386/simple_idct_mmx.o i386/fft_sse.o i386/vp3dsp_mmx.o \ + i386/vp3dsp_sse2.o i386/fft_3dn.o i386/fft_3dn2.o i386/snowdsp_mmx.o ++i386/dsputil_mmx.o: CFLAGS+= -mmmx ++depend: CFLAGS+= -mmmx + ifeq ($(CONFIG_GPL),yes) + OBJS += i386/idct_mmx_xvid.o + endif +Index: ffmpeg-0.cvs20060724/libavcodec/i386/dsputil_mmx.c +=================================================================== +--- ffmpeg-0.cvs20060724.orig/libavcodec/i386/dsputil_mmx.c 2006-07-24 17:11:16.000000000 +0200 ++++ ffmpeg-0.cvs20060724/libavcodec/i386/dsputil_mmx.c 2006-07-24 17:22:05.000000000 +0200 +@@ -26,6 +26,8 @@ + #include "x86_cpu.h" + #include "mmx.h" + ++#include ++ + //#undef NDEBUG + //#include + +@@ -624,32 +626,22 @@ + } + + static inline void transpose4x4(uint8_t *dst, uint8_t *src, int dst_stride, int src_stride){ +- asm volatile( //FIXME could save 1 instruction if done as 8x4 ... +- "movd %4, %%mm0 \n\t" +- "movd %5, %%mm1 \n\t" +- "movd %6, %%mm2 \n\t" +- "movd %7, %%mm3 \n\t" +- "punpcklbw %%mm1, %%mm0 \n\t" +- "punpcklbw %%mm3, %%mm2 \n\t" +- "movq %%mm0, %%mm1 \n\t" +- "punpcklwd %%mm2, %%mm0 \n\t" +- "punpckhwd %%mm2, %%mm1 \n\t" +- "movd %%mm0, %0 \n\t" +- "punpckhdq %%mm0, %%mm0 \n\t" +- "movd %%mm0, %1 \n\t" +- "movd %%mm1, %2 \n\t" +- "punpckhdq %%mm1, %%mm1 \n\t" +- "movd %%mm1, %3 \n\t" +- +- : "=m" (*(uint32_t*)(dst + 0*dst_stride)), +- "=m" (*(uint32_t*)(dst + 1*dst_stride)), +- "=m" (*(uint32_t*)(dst + 2*dst_stride)), +- "=m" (*(uint32_t*)(dst + 3*dst_stride)) +- : "m" (*(uint32_t*)(src + 0*src_stride)), +- "m" (*(uint32_t*)(src + 1*src_stride)), +- "m" (*(uint32_t*)(src + 2*src_stride)), +- "m" (*(uint32_t*)(src + 3*src_stride)) +- ); ++ __v8qi mm0, mm1, mm2, mm3; ++ mm0 = (__v8qi)(uint64_t)*(uint32_t*)(src + 0*src_stride); ++ mm1 = (__v8qi)(uint64_t)*(uint32_t*)(src + 1*src_stride); ++ mm2 = (__v8qi)(uint64_t)*(uint32_t*)(src + 2*src_stride); ++ mm3 = (__v8qi)(uint64_t)*(uint32_t*)(src + 3*src_stride); ++ mm0 = __builtin_ia32_punpcklbw(mm1, mm0); ++ mm2 = __builtin_ia32_punpcklbw(mm3, mm2); ++ mm1 = mm0; ++ mm0 = __builtin_ia32_punpckhwd(mm2, mm0); ++ mm1 = __builtin_ia32_punpckhwd(mm2, mm1); ++ *(uint32_t*)(dst + 0*dst_stride) = (uint64_t)mm0; ++ mm0 = __builtin_ia32_punpckhdq(mm0, mm0); ++ *(uint32_t*)(dst + 1*dst_stride) = (uint64_t)mm0; ++ *(uint32_t*)(dst + 2*dst_stride) = (uint64_t)mm1; ++ mm1 = __builtin_ia32_punpckhdq(mm1, mm1); ++ *(uint32_t*)(dst + 3*dst_stride) = (uint64_t)mm1; + } + + static void h263_h_loop_filter_mmx(uint8_t *src, int stride, int qscale){ --- ffmpeg-0.cvs20070307.orig/debian/patches/102_security_CVE-2009-0385.diff +++ ffmpeg-0.cvs20070307/debian/patches/102_security_CVE-2009-0385.diff @@ -0,0 +1,23 @@ +# +# Description: fix arbitrary code execution via a malformed 4X movie file +# Ubuntu: https://bugs.launchpad.net/ubuntu/+source/ffmpeg/+bug/323620 +# Patch: http://git.ffmpeg.org/?p=ffmpeg;a=commitdiff;h=72e715fb798f2cb79fd24a6d2eaeafb7c6eeda17 +# +diff -Nur ffmpeg-0.cvs20070307/libavformat/4xm.c ffmpeg-0.cvs20070307.new/libavformat/4xm.c +--- ffmpeg-0.cvs20070307/libavformat/4xm.c 2007-03-07 05:17:32.000000000 -0500 ++++ ffmpeg-0.cvs20070307.new/libavformat/4xm.c 2009-03-13 13:04:03.000000000 -0400 +@@ -161,10 +161,12 @@ + return AVERROR_INVALIDDATA; + } + current_track = AV_RL32(&header[i + 8]); ++ if((unsigned)current_track >= UINT_MAX / sizeof(AudioTrack) - 1){ ++ av_log(s, AV_LOG_ERROR, "current_track too large\n"); ++ return -1; ++ } + if (current_track + 1 > fourxm->track_count) { + fourxm->track_count = current_track + 1; +- if((unsigned)fourxm->track_count >= UINT_MAX / sizeof(AudioTrack)) +- return -1; + fourxm->tracks = av_realloc(fourxm->tracks, + fourxm->track_count * sizeof(AudioTrack)); + if (!fourxm->tracks) { --- ffmpeg-0.cvs20070307.orig/debian/patches/010_shared_library_versioning.diff +++ ffmpeg-0.cvs20070307/debian/patches/010_shared_library_versioning.diff @@ -0,0 +1,123 @@ +Index: ffmpeg-0.cvs20070307/configure +=================================================================== +--- ffmpeg-0.cvs20070307.orig/configure 2007-03-09 17:07:42.000000000 +0100 ++++ ffmpeg-0.cvs20070307/configure 2007-03-09 17:18:29.000000000 +0100 +@@ -1924,11 +1924,11 @@ + echo "BUILD_DOC=yes" >> config.mak + fi + +-sws_version=`grep '#define LIBSWSCALE_VERSION ' "$source_path/libswscale/swscale.h" | sed 's/[^0-9\.]//g'` +-pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'` +-lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'` +-lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'` +-lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'` ++sws_version=`grep '#define LIBSWSCALE_VERSION ' "$source_path/libswscale/swscale.h" | sed 's/[^0-9\.]*//'` ++pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libpostproc/postprocess.h" | sed 's/[^0-9\.]*//'` ++lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]*//'` ++lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]*//'` ++lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]*//'` + + + +@@ -2057,9 +2057,9 @@ + pkgconfig_generate(){ + name=$1 + comment=$2 +-version=$3 ++version=$(echo $3 | sed 's/\<[0-9][0-9]*d[.]//g') + libs=$4 +-requires=$5 ++requires=$(echo $5 | sed 's/\<[0-9][0-9]*d[.]//g') + include=$6 + cat <$name.pc + prefix=$PREFIX +@@ -2081,9 +2081,9 @@ + name=$1 + shortname=${name#lib} + comment=$2 +-version=$3 ++version=$(echo $3 | sed 's/\<[0-9][0-9]*d[.]//g') + libs=$4 +-requires=$5 ++requires=$(echo $5 | sed 's/\<[0-9][0-9]*d[.]//g') + cat <$name-uninstalled.pc + prefix= + exec_prefix= +Index: ffmpeg-0.cvs20070307/libavutil/avutil.h +=================================================================== +--- ffmpeg-0.cvs20070307.orig/libavutil/avutil.h 2007-03-07 14:37:01.000000000 +0100 ++++ ffmpeg-0.cvs20070307/libavutil/avutil.h 2007-03-09 17:07:44.000000000 +0100 +@@ -35,7 +35,7 @@ + #define AV_TOSTRING(s) #s + + #define LIBAVUTIL_VERSION_INT ((49<<16)+(3<<8)+0) +-#define LIBAVUTIL_VERSION 49.3.0 ++#define LIBAVUTIL_VERSION 1d.49.3.0 + #define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT + + #define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION) +Index: ffmpeg-0.cvs20070307/libavcodec/avcodec.h +=================================================================== +--- ffmpeg-0.cvs20070307.orig/libavcodec/avcodec.h 2007-03-07 14:37:04.000000000 +0100 ++++ ffmpeg-0.cvs20070307/libavcodec/avcodec.h 2007-03-09 17:07:44.000000000 +0100 +@@ -38,7 +38,7 @@ + #define AV_TOSTRING(s) #s + + #define LIBAVCODEC_VERSION_INT ((51<<16)+(38<<8)+0) +-#define LIBAVCODEC_VERSION 51.38.0 ++#define LIBAVCODEC_VERSION 1d.51.38.0 + #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT + + #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION) +Index: ffmpeg-0.cvs20070307/libavformat/avformat.h +=================================================================== +--- ffmpeg-0.cvs20070307.orig/libavformat/avformat.h 2007-03-07 14:37:06.000000000 +0100 ++++ ffmpeg-0.cvs20070307/libavformat/avformat.h 2007-03-09 17:07:44.000000000 +0100 +@@ -26,7 +26,7 @@ + #endif + + #define LIBAVFORMAT_VERSION_INT ((51<<16)+(10<<8)+0) +-#define LIBAVFORMAT_VERSION 51.10.0 ++#define LIBAVFORMAT_VERSION 1d.51.10.0 + #define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT + + #define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION) +Index: ffmpeg-0.cvs20070307/common.mak +=================================================================== +--- ffmpeg-0.cvs20070307.orig/common.mak 2007-03-07 14:37:06.000000000 +0100 ++++ ffmpeg-0.cvs20070307/common.mak 2007-03-09 17:07:44.000000000 +0100 +@@ -68,7 +68,7 @@ + cd "$(shlibdir)" && \ + ln -sf $(SLIBNAME_WITH_VERSION) $(SLIBNAME_WITH_MAJOR) + cd "$(shlibdir)" && \ +- ln -sf $(SLIBNAME_WITH_VERSION) $(SLIBNAME) ++ ln -sf $(SLIBNAME_WITH_MAJOR) $(SLIBNAME) + $(SLIB_INSTALL_EXTRA_CMD) + + install-lib-static: $(LIB) +Index: ffmpeg-0.cvs20070307/libpostproc/postprocess.h +=================================================================== +--- ffmpeg-0.cvs20070307.orig/libpostproc/postprocess.h 2007-03-07 11:17:32.000000000 +0100 ++++ ffmpeg-0.cvs20070307/libpostproc/postprocess.h 2007-03-09 17:07:44.000000000 +0100 +@@ -32,7 +32,7 @@ + #endif + + #define LIBPOSTPROC_VERSION_INT ((51<<16)+(1<<8)+0) +-#define LIBPOSTPROC_VERSION 51.1.0 ++#define LIBPOSTPROC_VERSION 1d.51.1.0 + #define LIBPOSTPROC_BUILD LIBPOSTPROC_VERSION_INT + + #define LIBPOSTPROC_IDENT "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION) +Index: ffmpeg-0.cvs20070307/libswscale/swscale.h +=================================================================== +--- ffmpeg-0.cvs20070307.orig/libswscale/swscale.h 2007-03-07 11:17:32.000000000 +0100 ++++ ffmpeg-0.cvs20070307/libswscale/swscale.h 2007-03-09 17:07:44.000000000 +0100 +@@ -37,7 +37,7 @@ + #define AV_TOSTRING(s) #s + + #define LIBSWSCALE_VERSION_INT ((0<<16)+(5<<8)+0) +-#define LIBSWSCALE_VERSION 0.5.0 ++#define LIBSWSCALE_VERSION 1d.0.5.0 + #define LIBSWSCALE_BUILD LIBSWSCALE_VERSION_INT + + #define LIBSWSCALE_IDENT "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION) --- ffmpeg-0.cvs20070307.orig/debian/patches/053_rm_demux_crash.diff +++ ffmpeg-0.cvs20070307/debian/patches/053_rm_demux_crash.diff @@ -0,0 +1,25 @@ +Index: ffmpeg-0.cvs20060823/libavformat/rm.c +=================================================================== +--- ffmpeg-0.cvs20060823.orig/libavformat/rm.c 2007-03-23 22:42:34.000000000 +0100 ++++ ffmpeg-0.cvs20060823/libavformat/rm.c 2007-03-23 22:43:28.000000000 +0100 +@@ -959,9 +959,8 @@ + len=len2; + rm->remaining_len-= len; + av_get_packet(pb, pkt, len); +- } + +- if (st->codec->codec_type == CODEC_TYPE_AUDIO) { ++ } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) { + if ((st->codec->codec_id == CODEC_ID_RA_288) || + (st->codec->codec_id == CODEC_ID_COOK)) { + int x; +@@ -1013,7 +1012,8 @@ + } + } else + av_get_packet(pb, pkt, len); +- } ++ ++ } else goto resync; + + if( (st->discard >= AVDISCARD_NONKEY && !(flags&2)) + || st->discard >= AVDISCARD_ALL){ --- ffmpeg-0.cvs20070307.orig/debian/patches/005_runtime_cpudetect.diff +++ ffmpeg-0.cvs20070307/debian/patches/005_runtime_cpudetect.diff @@ -0,0 +1,15 @@ +Index: ffmpeg.svn/configure +=================================================================== +--- ffmpeg.svn.orig/configure 2007-03-05 20:45:57.000000000 +0100 ++++ ffmpeg.svn/configure 2007-03-05 20:49:10.000000000 +0100 +@@ -2012,6 +2012,10 @@ + echo "#define __CPU__ 586" >> $TMPH + fi + ++if test "$cpu" != "m68k" -a "$cpu" != "x86" ; then ++ echo "#define RUNTIME_CPUDETECT 1" >> $TMPH ++fi ++ + if enabled sdl; then + echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak + echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak --- ffmpeg-0.cvs20070307.orig/debian/patches/020_mmx_optims.diff +++ ffmpeg-0.cvs20070307/debian/patches/020_mmx_optims.diff @@ -0,0 +1,12 @@ +Index: ffmpeg-0.cvs20060724/libavcodec/Makefile +=================================================================== +--- ffmpeg-0.cvs20060724.orig/libavcodec/Makefile 2006-07-24 17:11:20.000000000 +0200 ++++ ffmpeg-0.cvs20060724/libavcodec/Makefile 2006-07-24 17:22:05.000000000 +0200 +@@ -285,6 +285,7 @@ + i386/fft_3dn.o \ + i386/fft_3dn2.o \ + ++i386/dsputil_mmx.o: CFLAGS+= -O3 # "-O2" isn't enough, nor is "-O2 -finline-functions -frename-registers" (so long for gcc documentation) + OBJS-$(CONFIG_GPL) += i386/idct_mmx.o + OBJS-$(CONFIG_CAVS_DECODER) += i386/cavsdsp_mmx.o + OBJS-$(CONFIG_SNOW_DECODER) += i386/snowdsp_mmx.o --- ffmpeg-0.cvs20070307.orig/debian/patches/040_only_use_maltivec_when_needed.diff +++ ffmpeg-0.cvs20070307/debian/patches/040_only_use_maltivec_when_needed.diff @@ -0,0 +1,1954 @@ +Index: ffmpeg-0.cvs20070307/configure +=================================================================== +--- ffmpeg-0.cvs20070307.orig/configure 2007-03-28 16:07:04.000000000 +0200 ++++ ffmpeg-0.cvs20070307/configure 2007-03-28 16:17:39.000000000 +0200 +@@ -1410,11 +1410,13 @@ + if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then + add_cflags "-faltivec" + else +- add_cflags "-maltivec" ++ ALTIVECFLAGS="$ALTIVECFLAGS -maltivec" + fi + fi + fi + ++save_flags ++temp_cflags $ALTIVECFLAGS + check_header altivec.h + + # check if our compiler supports Motorola AltiVec C API +@@ -1461,6 +1463,7 @@ + } + EOF + fi ++restore_flags + + # mmi only available on mips + if test $mmi = "default"; then +@@ -1862,6 +1865,7 @@ + fi + + echo "OPTFLAGS=$CFLAGS" >> config.mak ++echo "ALTIVECFLAGS=$ALTIVECFLAGS" >> config.mak + echo "VHOOKCFLAGS=$VHOOKCFLAGS">>config.mak + echo "LDFLAGS=$LDFLAGS" >> config.mak + echo "LDCONFIG=$LDCONFIG" >> config.mak +Index: ffmpeg-0.cvs20070307/libavcodec/Makefile +=================================================================== +--- ffmpeg-0.cvs20070307.orig/libavcodec/Makefile 2007-03-28 16:17:35.000000000 +0200 ++++ ffmpeg-0.cvs20070307/libavcodec/Makefile 2007-03-28 16:17:59.000000000 +0200 +@@ -310,7 +310,8 @@ + + OBJS-$(HAVE_XVMC_ACCEL) += xvmcvideo.o + +-OBJS += imgresample.o ++OBJS += imgresample.o imgresample_altivec.o ++imgresample_altivec.o: CFLAGS+= $(ALTIVECFLAGS) + + # i386 mmx specific stuff + ifeq ($(TARGET_MMX),yes) +@@ -385,11 +386,22 @@ + ppc/fdct_altivec.o \ + ppc/float_altivec.o \ + ++ppc/dsputil_altivec.o: CFLAGS+= $(ALTIVECFLAGS) ++ppc/mpegvideo_altivec.o: CFLAGS+= $(ALTIVECFLAGS) ++ppc/idct_altivec.o: CFLAGS+= $(ALTIVECFLAGS) ++ppc/fft_altivec.o: CFLAGS+= $(ALTIVECFLAGS) ++ppc/gmc_altivec.o: CFLAGS+= $(ALTIVECFLAGS) ++ppc/fdct_altivec.o: CFLAGS+= $(ALTIVECFLAGS) ++ppc/float_altivec.o: CFLAGS+= $(ALTIVECFLAGS) ++ + ifeq ($(TARGET_ALTIVEC),yes) + OBJS-$(CONFIG_H264_DECODER) += ppc/h264_altivec.o + OBJS-$(CONFIG_SNOW_DECODER) += ppc/snow_altivec.o + OBJS-$(CONFIG_VC1_DECODER) += ppc/vc1dsp_altivec.o + OBJS-$(CONFIG_WMV3_DECODER) += ppc/vc1dsp_altivec.o ++ppc/h264_altivec.o: CFLAGS+= $(ALTIVECFLAGS) ++ppc/snow_altivec.o: CFLAGS+= $(ALTIVECFLAGS) ++ppc/vc1dsp_altivec.o: CFLAGS+= $(ALTIVECFLAGS) + endif + + OBJS-$(TARGET_ARCH_BFIN) += bfin/dsputil_bfin.o \ +Index: ffmpeg-0.cvs20070307/libavcodec/dsputil.h +=================================================================== +--- ffmpeg-0.cvs20070307.orig/libavcodec/dsputil.h 2007-03-07 14:37:04.000000000 +0100 ++++ ffmpeg-0.cvs20070307/libavcodec/dsputil.h 2007-03-28 16:17:39.000000000 +0200 +@@ -556,12 +556,6 @@ + + extern int mm_flags; + +-#if defined(HAVE_ALTIVEC) && !defined(CONFIG_DARWIN) +-#define pixel altivec_pixel +-#include +-#undef pixel +-#endif +- + #define DECLARE_ALIGNED_8(t,v) t v __attribute__ ((aligned (16))) + #define STRIDE_ALIGN 16 + +Index: ffmpeg-0.cvs20070307/libavcodec/imgresample.c +=================================================================== +--- ffmpeg-0.cvs20070307.orig/libavcodec/imgresample.c 2007-03-07 14:37:04.000000000 +0100 ++++ ffmpeg-0.cvs20070307/libavcodec/imgresample.c 2007-03-28 16:17:39.000000000 +0200 +@@ -284,133 +284,6 @@ + } + #endif + +-#ifdef HAVE_ALTIVEC +-typedef union { +- vector unsigned char v; +- unsigned char c[16]; +-} vec_uc_t; +- +-typedef union { +- vector signed short v; +- signed short s[8]; +-} vec_ss_t; +- +-void v_resample16_altivec(uint8_t *dst, int dst_width, const uint8_t *src, +- int wrap, int16_t *filter) +-{ +- int sum, i; +- const uint8_t *s; +- vector unsigned char *tv, tmp, dstv, zero; +- vec_ss_t srchv[4], srclv[4], fv[4]; +- vector signed short zeros, sumhv, sumlv; +- s = src; +- +- for(i=0;i<4;i++) +- { +- /* +- The vec_madds later on does an implicit >>15 on the result. +- Since FILTER_BITS is 8, and we have 15 bits of magnitude in +- a signed short, we have just enough bits to pre-shift our +- filter constants <<7 to compensate for vec_madds. +- */ +- fv[i].s[0] = filter[i] << (15-FILTER_BITS); +- fv[i].v = vec_splat(fv[i].v, 0); +- } +- +- zero = vec_splat_u8(0); +- zeros = vec_splat_s16(0); +- +- +- /* +- When we're resampling, we'd ideally like both our input buffers, +- and output buffers to be 16-byte aligned, so we can do both aligned +- reads and writes. Sadly we can't always have this at the moment, so +- we opt for aligned writes, as unaligned writes have a huge overhead. +- To do this, do enough scalar resamples to get dst 16-byte aligned. +- */ +- i = (-(int)dst) & 0xf; +- while(i>0) { +- sum = s[0 * wrap] * filter[0] + +- s[1 * wrap] * filter[1] + +- s[2 * wrap] * filter[2] + +- s[3 * wrap] * filter[3]; +- sum = sum >> FILTER_BITS; +- if (sum<0) sum = 0; else if (sum>255) sum=255; +- dst[0] = sum; +- dst++; +- s++; +- dst_width--; +- i--; +- } +- +- /* Do our altivec resampling on 16 pixels at once. */ +- while(dst_width>=16) { +- /* +- Read 16 (potentially unaligned) bytes from each of +- 4 lines into 4 vectors, and split them into shorts. +- Interleave the multipy/accumulate for the resample +- filter with the loads to hide the 3 cycle latency +- the vec_madds have. +- */ +- tv = (vector unsigned char *) &s[0 * wrap]; +- tmp = vec_perm(tv[0], tv[1], vec_lvsl(0, &s[i * wrap])); +- srchv[0].v = (vector signed short) vec_mergeh(zero, tmp); +- srclv[0].v = (vector signed short) vec_mergel(zero, tmp); +- sumhv = vec_madds(srchv[0].v, fv[0].v, zeros); +- sumlv = vec_madds(srclv[0].v, fv[0].v, zeros); +- +- tv = (vector unsigned char *) &s[1 * wrap]; +- tmp = vec_perm(tv[0], tv[1], vec_lvsl(0, &s[1 * wrap])); +- srchv[1].v = (vector signed short) vec_mergeh(zero, tmp); +- srclv[1].v = (vector signed short) vec_mergel(zero, tmp); +- sumhv = vec_madds(srchv[1].v, fv[1].v, sumhv); +- sumlv = vec_madds(srclv[1].v, fv[1].v, sumlv); +- +- tv = (vector unsigned char *) &s[2 * wrap]; +- tmp = vec_perm(tv[0], tv[1], vec_lvsl(0, &s[2 * wrap])); +- srchv[2].v = (vector signed short) vec_mergeh(zero, tmp); +- srclv[2].v = (vector signed short) vec_mergel(zero, tmp); +- sumhv = vec_madds(srchv[2].v, fv[2].v, sumhv); +- sumlv = vec_madds(srclv[2].v, fv[2].v, sumlv); +- +- tv = (vector unsigned char *) &s[3 * wrap]; +- tmp = vec_perm(tv[0], tv[1], vec_lvsl(0, &s[3 * wrap])); +- srchv[3].v = (vector signed short) vec_mergeh(zero, tmp); +- srclv[3].v = (vector signed short) vec_mergel(zero, tmp); +- sumhv = vec_madds(srchv[3].v, fv[3].v, sumhv); +- sumlv = vec_madds(srclv[3].v, fv[3].v, sumlv); +- +- /* +- Pack the results into our destination vector, +- and do an aligned write of that back to memory. +- */ +- dstv = vec_packsu(sumhv, sumlv) ; +- vec_st(dstv, 0, (vector unsigned char *) dst); +- +- dst+=16; +- s+=16; +- dst_width-=16; +- } +- +- /* +- If there are any leftover pixels, resample them +- with the slow scalar method. +- */ +- while(dst_width>0) { +- sum = s[0 * wrap] * filter[0] + +- s[1 * wrap] * filter[1] + +- s[2 * wrap] * filter[2] + +- s[3 * wrap] * filter[3]; +- sum = sum >> FILTER_BITS; +- if (sum<0) sum = 0; else if (sum>255) sum=255; +- dst[0] = sum; +- dst++; +- s++; +- dst_width--; +- } +-} +-#endif +- + /* slow version to handle limit cases. Does not need optimisation */ + static void h_resample_slow(uint8_t *dst, int dst_width, + const uint8_t *src, int src_width, +Index: ffmpeg-0.cvs20070307/libavcodec/imgresample_altivec.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ ffmpeg-0.cvs20070307/libavcodec/imgresample_altivec.c 2007-03-28 16:17:39.000000000 +0200 +@@ -0,0 +1,164 @@ ++/* ++ * High quality image resampling with polyphase filters ++ * Copyright (c) 2001 Fabrice Bellard. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++/** ++ * @file imgresample_altivec.c ++ * High quality image resampling with polyphase filters, AltiVec version. ++ */ ++ ++#include "avcodec.h" ++#include "swscale.h" ++#include "dsputil.h" ++ ++#if defined(HAVE_ALTIVEC) && !defined(CONFIG_DARWIN) ++#define pixel altivec_pixel ++#include ++#undef pixel ++#endif ++ ++/* 6 bits precision is needed for MMX */ ++#define FILTER_BITS 8 ++ ++#ifdef HAVE_ALTIVEC ++typedef union { ++ vector unsigned char v; ++ unsigned char c[16]; ++} vec_uc_t; ++ ++typedef union { ++ vector signed short v; ++ signed short s[8]; ++} vec_ss_t; ++ ++void v_resample16_altivec(uint8_t *dst, int dst_width, const uint8_t *src, ++ int wrap, int16_t *filter) ++{ ++ int sum, i; ++ const uint8_t *s; ++ vector unsigned char *tv, tmp, dstv, zero; ++ vec_ss_t srchv[4], srclv[4], fv[4]; ++ vector signed short zeros, sumhv, sumlv; ++ s = src; ++ ++ for(i=0;i<4;i++) ++ { ++ /* ++ The vec_madds later on does an implicit >>15 on the result. ++ Since FILTER_BITS is 8, and we have 15 bits of magnitude in ++ a signed short, we have just enough bits to pre-shift our ++ filter constants <<7 to compensate for vec_madds. ++ */ ++ fv[i].s[0] = filter[i] << (15-FILTER_BITS); ++ fv[i].v = vec_splat(fv[i].v, 0); ++ } ++ ++ zero = vec_splat_u8(0); ++ zeros = vec_splat_s16(0); ++ ++ ++ /* ++ When we're resampling, we'd ideally like both our input buffers, ++ and output buffers to be 16-byte aligned, so we can do both aligned ++ reads and writes. Sadly we can't always have this at the moment, so ++ we opt for aligned writes, as unaligned writes have a huge overhead. ++ To do this, do enough scalar resamples to get dst 16-byte aligned. ++ */ ++ i = (-(int)dst) & 0xf; ++ while(i>0) { ++ sum = s[0 * wrap] * filter[0] + ++ s[1 * wrap] * filter[1] + ++ s[2 * wrap] * filter[2] + ++ s[3 * wrap] * filter[3]; ++ sum = sum >> FILTER_BITS; ++ if (sum<0) sum = 0; else if (sum>255) sum=255; ++ dst[0] = sum; ++ dst++; ++ s++; ++ dst_width--; ++ i--; ++ } ++ ++ /* Do our altivec resampling on 16 pixels at once. */ ++ while(dst_width>=16) { ++ /* ++ Read 16 (potentially unaligned) bytes from each of ++ 4 lines into 4 vectors, and split them into shorts. ++ Interleave the multipy/accumulate for the resample ++ filter with the loads to hide the 3 cycle latency ++ the vec_madds have. ++ */ ++ tv = (vector unsigned char *) &s[0 * wrap]; ++ tmp = vec_perm(tv[0], tv[1], vec_lvsl(0, &s[i * wrap])); ++ srchv[0].v = (vector signed short) vec_mergeh(zero, tmp); ++ srclv[0].v = (vector signed short) vec_mergel(zero, tmp); ++ sumhv = vec_madds(srchv[0].v, fv[0].v, zeros); ++ sumlv = vec_madds(srclv[0].v, fv[0].v, zeros); ++ ++ tv = (vector unsigned char *) &s[1 * wrap]; ++ tmp = vec_perm(tv[0], tv[1], vec_lvsl(0, &s[1 * wrap])); ++ srchv[1].v = (vector signed short) vec_mergeh(zero, tmp); ++ srclv[1].v = (vector signed short) vec_mergel(zero, tmp); ++ sumhv = vec_madds(srchv[1].v, fv[1].v, sumhv); ++ sumlv = vec_madds(srclv[1].v, fv[1].v, sumlv); ++ ++ tv = (vector unsigned char *) &s[2 * wrap]; ++ tmp = vec_perm(tv[0], tv[1], vec_lvsl(0, &s[2 * wrap])); ++ srchv[2].v = (vector signed short) vec_mergeh(zero, tmp); ++ srclv[2].v = (vector signed short) vec_mergel(zero, tmp); ++ sumhv = vec_madds(srchv[2].v, fv[2].v, sumhv); ++ sumlv = vec_madds(srclv[2].v, fv[2].v, sumlv); ++ ++ tv = (vector unsigned char *) &s[3 * wrap]; ++ tmp = vec_perm(tv[0], tv[1], vec_lvsl(0, &s[3 * wrap])); ++ srchv[3].v = (vector signed short) vec_mergeh(zero, tmp); ++ srclv[3].v = (vector signed short) vec_mergel(zero, tmp); ++ sumhv = vec_madds(srchv[3].v, fv[3].v, sumhv); ++ sumlv = vec_madds(srclv[3].v, fv[3].v, sumlv); ++ ++ /* ++ Pack the results into our destination vector, ++ and do an aligned write of that back to memory. ++ */ ++ dstv = vec_packsu(sumhv, sumlv) ; ++ vec_st(dstv, 0, (vector unsigned char *) dst); ++ ++ dst+=16; ++ s+=16; ++ dst_width-=16; ++ } ++ ++ /* ++ If there are any leftover pixels, resample them ++ with the slow scalar method. ++ */ ++ while(dst_width>0) { ++ sum = s[0 * wrap] * filter[0] + ++ s[1 * wrap] * filter[1] + ++ s[2 * wrap] * filter[2] + ++ s[3 * wrap] * filter[3]; ++ sum = sum >> FILTER_BITS; ++ if (sum<0) sum = 0; else if (sum>255) sum=255; ++ dst[0] = sum; ++ dst++; ++ s++; ++ dst_width--; ++ } ++} ++#endif ++ +Index: ffmpeg-0.cvs20070307/libpostproc/Makefile +=================================================================== +--- ffmpeg-0.cvs20070307.orig/libpostproc/Makefile 2007-03-07 14:37:04.000000000 +0100 ++++ ffmpeg-0.cvs20070307/libpostproc/Makefile 2007-03-28 16:17:39.000000000 +0200 +@@ -10,8 +10,10 @@ + LIBVERSION=$(SPPVERSION) + LIBMAJOR=$(SPPMAJOR) + +-STATIC_OBJS=postprocess.o +-SHARED_OBJS=postprocess_pic.o ++STATIC_OBJS=postprocess.o postprocess_altivec.o ++SHARED_OBJS=postprocess_pic.o postprocess_altivec_pic.o ++postprocess_altivec.o: CFLAGS+= $(ALTIVECFLAGS) ++postprocess_altivec_pic.o: CFLAGS+= $(ALTIVECFLAGS) + + HEADERS = postprocess.h + +@@ -21,4 +23,6 @@ + + postprocess_pic.o: postprocess.c + $(CC) -c $(CFLAGS) -fomit-frame-pointer -fPIC -DPIC -o $@ $< ++postprocess_altivec_pic.o: postprocess_altivec.c ++ $(CC) -c $(CFLAGS) -fomit-frame-pointer -fPIC -DPIC -o $@ $< + +Index: ffmpeg-0.cvs20070307/libpostproc/postprocess.c +=================================================================== +--- ffmpeg-0.cvs20070307.orig/libpostproc/postprocess.c 2007-03-07 11:17:32.000000000 +0100 ++++ ffmpeg-0.cvs20070307/libpostproc/postprocess.c 2007-03-28 16:17:39.000000000 +0200 +@@ -95,10 +95,6 @@ + + #include "mangle.h" //FIXME should be supressed + +-#ifdef HAVE_ALTIVEC_H +-#include +-#endif +- + #define GET_MODE_BUFFER_SIZE 500 + #define OPTIONS_ARRAY_SIZE 10 + #define BLOCK_SIZE 8 +@@ -614,8 +610,9 @@ + #undef RENAME + #define HAVE_ALTIVEC + #define RENAME(a) a ## _altivec +-#include "postprocess_altivec_template.c" +-#include "postprocess_template.c" ++//#include "postprocess_altivec_template.c" ++//#include "postprocess_template.c" ++void RENAME(postProcess)(uint8_t src[], int srcStride, uint8_t dst[], int dstStride, int width, int height, QP_STORE_T QPs[], int QPStride, int isColor, PPContext *c); + #endif + #endif //ARCH_POWERPC + +Index: ffmpeg-0.cvs20070307/libpostproc/postprocess_altivec.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ ffmpeg-0.cvs20070307/libpostproc/postprocess_altivec.c 2007-03-28 16:17:39.000000000 +0200 +@@ -0,0 +1,614 @@ ++/* ++ Copyright (C) 2001-2003 Michael Niedermayer (michaelni@gmx.at) ++ ++ AltiVec optimizations (C) 2004 Romain Dolbeau ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++*/ ++ ++/** ++ * @file postprocess.c ++ * postprocessing. ++ */ ++ ++/* ++ C MMX MMX2 3DNow AltiVec ++isVertDC Ec Ec Ec ++isVertMinMaxOk Ec Ec Ec ++doVertLowPass E e e Ec ++doVertDefFilter Ec Ec e e Ec ++isHorizDC Ec Ec Ec ++isHorizMinMaxOk a E Ec ++doHorizLowPass E e e Ec ++doHorizDefFilter Ec Ec e e Ec ++do_a_deblock Ec E Ec E ++deRing E e e* Ecp ++Vertical RKAlgo1 E a a ++Horizontal RKAlgo1 a a ++Vertical X1# a E E ++Horizontal X1# a E E ++LinIpolDeinterlace e E E* ++CubicIpolDeinterlace a e e* ++LinBlendDeinterlace e E E* ++MedianDeinterlace# E Ec Ec ++TempDeNoiser# E e e Ec ++ ++* i dont have a 3dnow CPU -> its untested, but noone said it doesnt work so it seems to work ++# more or less selfinvented filters so the exactness isnt too meaningfull ++E = Exact implementation ++e = allmost exact implementation (slightly different rounding,...) ++a = alternative / approximate impl ++c = checked against the other implementations (-vo md5) ++p = partially optimized, still some work to do ++*/ ++ ++/* ++TODO: ++reduce the time wasted on the mem transfer ++unroll stuff if instructions depend too much on the prior one ++move YScale thing to the end instead of fixing QP ++write a faster and higher quality deblocking filter :) ++make the mainloop more flexible (variable number of blocks at once ++ (the if/else stuff per block is slowing things down) ++compare the quality & speed of all filters ++split this huge file ++optimize c versions ++try to unroll inner for(x=0 ... loop to avoid these damn if(x ... checks ++... ++*/ ++ ++//Changelog: use the Subversion log ++ ++#include "config.h" ++#include ++#include ++#include ++#include ++#ifdef HAVE_MALLOC_H ++#include ++#endif ++//#undef HAVE_MMX2 ++//#define HAVE_3DNOW ++//#undef HAVE_MMX ++//#undef ARCH_X86 ++//#define DEBUG_BRIGHTNESS ++#ifdef USE_FASTMEMCPY ++#include "libvo/fastmemcpy.h" ++#endif ++#include "postprocess.h" ++#include "postprocess_internal.h" ++ ++#include "mangle.h" //FIXME should be supressed ++ ++#ifdef HAVE_ALTIVEC_H ++#include ++#endif ++ ++#ifndef HAVE_MEMALIGN ++#define memalign(a,b) malloc(b) ++#endif ++ ++#define MIN(a,b) ((a) > (b) ? (b) : (a)) ++#define MAX(a,b) ((a) < (b) ? (b) : (a)) ++#define ABS(a) ((a) > 0 ? (a) : (-(a))) ++#define SIGN(a) ((a) > 0 ? 1 : -1) ++ ++#define GET_MODE_BUFFER_SIZE 500 ++#define OPTIONS_ARRAY_SIZE 10 ++#define BLOCK_SIZE 8 ++#define TEMP_STRIDE 8 ++//#define NUM_BLOCKS_AT_ONCE 16 //not used yet ++ ++#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0) ++# define attribute_used __attribute__((used)) ++# define always_inline __attribute__((always_inline)) inline ++#else ++# define attribute_used ++# define always_inline inline ++#endif ++ ++#if defined(ARCH_X86) || defined(ARCH_X86_64) ++static uint64_t __attribute__((aligned(8))) attribute_used w05= 0x0005000500050005LL; ++static uint64_t __attribute__((aligned(8))) attribute_used w04= 0x0004000400040004LL; ++static uint64_t __attribute__((aligned(8))) attribute_used w20= 0x0020002000200020LL; ++static uint64_t __attribute__((aligned(8))) attribute_used b00= 0x0000000000000000LL; ++static uint64_t __attribute__((aligned(8))) attribute_used b01= 0x0101010101010101LL; ++static uint64_t __attribute__((aligned(8))) attribute_used b02= 0x0202020202020202LL; ++static uint64_t __attribute__((aligned(8))) attribute_used b08= 0x0808080808080808LL; ++static uint64_t __attribute__((aligned(8))) attribute_used b80= 0x8080808080808080LL; ++#endif ++ ++static uint8_t clip_table[3*256]; ++static uint8_t * const clip_tab= clip_table + 256; ++ ++static const int verbose= 0; ++ ++static const int attribute_used deringThreshold= 20; ++ ++ ++static struct PPFilter filters[]= ++{ ++ {"hb", "hdeblock", 1, 1, 3, H_DEBLOCK}, ++ {"vb", "vdeblock", 1, 2, 4, V_DEBLOCK}, ++/* {"hr", "rkhdeblock", 1, 1, 3, H_RK1_FILTER}, ++ {"vr", "rkvdeblock", 1, 2, 4, V_RK1_FILTER},*/ ++ {"h1", "x1hdeblock", 1, 1, 3, H_X1_FILTER}, ++ {"v1", "x1vdeblock", 1, 2, 4, V_X1_FILTER}, ++ {"ha", "ahdeblock", 1, 1, 3, H_A_DEBLOCK}, ++ {"va", "avdeblock", 1, 2, 4, V_A_DEBLOCK}, ++ {"dr", "dering", 1, 5, 6, DERING}, ++ {"al", "autolevels", 0, 1, 2, LEVEL_FIX}, ++ {"lb", "linblenddeint", 1, 1, 4, LINEAR_BLEND_DEINT_FILTER}, ++ {"li", "linipoldeint", 1, 1, 4, LINEAR_IPOL_DEINT_FILTER}, ++ {"ci", "cubicipoldeint", 1, 1, 4, CUBIC_IPOL_DEINT_FILTER}, ++ {"md", "mediandeint", 1, 1, 4, MEDIAN_DEINT_FILTER}, ++ {"fd", "ffmpegdeint", 1, 1, 4, FFMPEG_DEINT_FILTER}, ++ {"l5", "lowpass5", 1, 1, 4, LOWPASS5_DEINT_FILTER}, ++ {"tn", "tmpnoise", 1, 7, 8, TEMP_NOISE_FILTER}, ++ {"fq", "forcequant", 1, 0, 0, FORCE_QUANT}, ++ {NULL, NULL,0,0,0,0} //End Marker ++}; ++ ++static const char *replaceTable[]= ++{ ++ "default", "hdeblock:a,vdeblock:a,dering:a", ++ "de", "hdeblock:a,vdeblock:a,dering:a", ++ "fast", "x1hdeblock:a,x1vdeblock:a,dering:a", ++ "fa", "x1hdeblock:a,x1vdeblock:a,dering:a", ++ "ac", "ha:a:128:7,va:a,dering:a", ++ NULL //End Marker ++}; ++ ++ ++#if defined(ARCH_X86) || defined(ARCH_X86_64) ++static inline void prefetchnta(void *p) ++{ ++ asm volatile( "prefetchnta (%0)\n\t" ++ : : "r" (p) ++ ); ++} ++ ++static inline void prefetcht0(void *p) ++{ ++ asm volatile( "prefetcht0 (%0)\n\t" ++ : : "r" (p) ++ ); ++} ++ ++static inline void prefetcht1(void *p) ++{ ++ asm volatile( "prefetcht1 (%0)\n\t" ++ : : "r" (p) ++ ); ++} ++ ++static inline void prefetcht2(void *p) ++{ ++ 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 ++ ++/** ++ * Check if the given 8x8 Block is mostly "flat" ++ */ ++static inline int isHorizDC_C(uint8_t src[], int stride, PPContext *c) ++{ ++ int numEq= 0; ++ int y; ++ const int dcOffset= ((c->nonBQP*c->ppMode.baseDcDiff)>>8) + 1; ++ const int dcThreshold= dcOffset*2 + 1; ++ ++ for(y=0; y c->ppMode.flatnessThreshold; ++} ++ ++/** ++ * Check if the middle 8x8 Block in the given 8x16 block is flat ++ */ ++static inline int isVertDC_C(uint8_t src[], int stride, PPContext *c){ ++ int numEq= 0; ++ int y; ++ const int dcOffset= ((c->nonBQP*c->ppMode.baseDcDiff)>>8) + 1; ++ const int dcThreshold= dcOffset*2 + 1; ++ ++ src+= stride*4; // src points to begin of the 8x8 Block ++ for(y=0; y c->ppMode.flatnessThreshold; ++} ++ ++static inline int isHorizMinMaxOk_C(uint8_t src[], int stride, int QP) ++{ ++ int i; ++#if 1 ++ for(i=0; i<2; i++){ ++ if((unsigned)(src[0] - src[5] + 2*QP) > 4*QP) return 0; ++ src += stride; ++ if((unsigned)(src[2] - src[7] + 2*QP) > 4*QP) return 0; ++ src += stride; ++ if((unsigned)(src[4] - src[1] + 2*QP) > 4*QP) return 0; ++ src += stride; ++ if((unsigned)(src[6] - src[3] + 2*QP) > 4*QP) return 0; ++ src += stride; ++ } ++#else ++ for(i=0; i<8; i++){ ++ if((unsigned)(src[0] - src[7] + 2*QP) > 4*QP) return 0; ++ src += stride; ++ } ++#endif ++ return 1; ++} ++ ++static inline int isVertMinMaxOk_C(uint8_t src[], int stride, int QP) ++{ ++#if 1 ++#if 1 ++ int x; ++ src+= stride*4; ++ for(x=0; x 4*QP) return 0; ++ if((unsigned)(src[1+x + 2*stride] - src[1+x + 7*stride] + 2*QP) > 4*QP) return 0; ++ if((unsigned)(src[2+x + 4*stride] - src[2+x + 1*stride] + 2*QP) > 4*QP) return 0; ++ if((unsigned)(src[3+x + 6*stride] - src[3+x + 3*stride] + 2*QP) > 4*QP) return 0; ++ } ++#else ++ int x; ++ src+= stride*3; ++ for(x=0; x 4*QP) return 0; ++ } ++#endif ++ return 1; ++#else ++ int x; ++ src+= stride*4; ++ for(x=0; xmax) max=v; ++ if(v 2*QP) return 0; ++ } ++ return 1; ++#endif ++} ++ ++static inline int horizClassify_C(uint8_t src[], int stride, PPContext *c){ ++ if( isHorizDC_C(src, stride, c) ){ ++ if( isHorizMinMaxOk_C(src, stride, c->QP) ) ++ return 1; ++ else ++ return 0; ++ }else{ ++ return 2; ++ } ++} ++ ++static inline int vertClassify_C(uint8_t src[], int stride, PPContext *c){ ++ if( isVertDC_C(src, stride, c) ){ ++ if( isVertMinMaxOk_C(src, stride, c->QP) ) ++ return 1; ++ else ++ return 0; ++ }else{ ++ return 2; ++ } ++} ++ ++static inline void doHorizDefFilter_C(uint8_t dst[], int stride, PPContext *c) ++{ ++ int y; ++ for(y=0; yQP) ++ { ++ const int q=(dst[3] - dst[4])/2; ++ const int leftEnergy= 5*(dst[2] - dst[1]) + 2*(dst[0] - dst[3]); ++ const int rightEnergy= 5*(dst[6] - dst[5]) + 2*(dst[4] - dst[7]); ++ ++ int d= ABS(middleEnergy) - MIN( ABS(leftEnergy), ABS(rightEnergy) ); ++ d= MAX(d, 0); ++ ++ d= (5*d + 32) >> 6; ++ d*= SIGN(-middleEnergy); ++ ++ if(q>0) ++ { ++ d= d<0 ? 0 : d; ++ d= d>q ? q : d; ++ } ++ else ++ { ++ d= d>0 ? 0 : d; ++ d= dQP ? dst[-1] : dst[0]; ++ const int last= ABS(dst[8] - dst[7]) < c->QP ? dst[8] : dst[7]; ++ ++ int sums[10]; ++ sums[0] = 4*first + dst[0] + dst[1] + dst[2] + 4; ++ sums[1] = sums[0] - first + dst[3]; ++ sums[2] = sums[1] - first + dst[4]; ++ sums[3] = sums[2] - first + dst[5]; ++ sums[4] = sums[3] - first + dst[6]; ++ sums[5] = sums[4] - dst[0] + dst[7]; ++ sums[6] = sums[5] - dst[1] + last; ++ sums[7] = sums[6] - dst[2] + last; ++ sums[8] = sums[7] - dst[3] + last; ++ sums[9] = sums[8] - dst[4] + last; ++ ++ dst[0]= (sums[0] + sums[2] + 2*dst[0])>>4; ++ dst[1]= (sums[1] + sums[3] + 2*dst[1])>>4; ++ dst[2]= (sums[2] + sums[4] + 2*dst[2])>>4; ++ dst[3]= (sums[3] + sums[5] + 2*dst[3])>>4; ++ dst[4]= (sums[4] + sums[6] + 2*dst[4])>>4; ++ dst[5]= (sums[5] + sums[7] + 2*dst[5])>>4; ++ dst[6]= (sums[6] + sums[8] + 2*dst[6])>>4; ++ dst[7]= (sums[7] + sums[9] + 2*dst[7])>>4; ++ ++ dst+= stride; ++ } ++} ++ ++/** ++ * Experimental Filter 1 (Horizontal) ++ * will not damage linear gradients ++ * Flat blocks should look like they where passed through the (1,1,2,2,4,2,2,1,1) 9-Tap filter ++ * can only smooth blocks at the expected locations (it cant smooth them if they did move) ++ * MMX2 version does correct clipping C version doesnt ++ * not identical with the vertical one ++ */ ++static inline void horizX1Filter(uint8_t *src, int stride, int QP) ++{ ++ int y; ++ static uint64_t *lut= NULL; ++ if(lut==NULL) ++ { ++ int i; ++ lut= (uint64_t*)memalign(8, 256*8); ++ for(i=0; i<256; i++) ++ { ++ int v= i < 128 ? 2*i : 2*(i-256); ++/* ++//Simulate 112242211 9-Tap filter ++ uint64_t a= (v/16) & 0xFF; ++ uint64_t b= (v/8) & 0xFF; ++ uint64_t c= (v/4) & 0xFF; ++ uint64_t d= (3*v/8) & 0xFF; ++*/ ++//Simulate piecewise linear interpolation ++ uint64_t a= (v/16) & 0xFF; ++ uint64_t b= (v*3/16) & 0xFF; ++ uint64_t c= (v*5/16) & 0xFF; ++ uint64_t d= (7*v/16) & 0xFF; ++ uint64_t A= (0x100 - a)&0xFF; ++ uint64_t B= (0x100 - b)&0xFF; ++ uint64_t C= (0x100 - c)&0xFF; ++ uint64_t D= (0x100 - c)&0xFF; ++ ++ lut[i] = (a<<56) | (b<<48) | (c<<40) | (d<<32) | ++ (D<<24) | (C<<16) | (B<<8) | (A); ++ //lut[i] = (v<<32) | (v<<24); ++ } ++ } ++ ++ for(y=0; yQP; ++ const int dcOffset= ((c->nonBQP*c->ppMode.baseDcDiff)>>8) + 1; ++ const int dcThreshold= dcOffset*2 + 1; ++//START_TIMER ++ src+= step*4; // src points to begin of the 8x8 Block ++ for(y=0; y<8; y++){ ++ int numEq= 0; ++ ++ if(((unsigned)(src[-1*step] - src[0*step] + dcOffset)) < dcThreshold) numEq++; ++ if(((unsigned)(src[ 0*step] - src[1*step] + dcOffset)) < dcThreshold) numEq++; ++ if(((unsigned)(src[ 1*step] - src[2*step] + dcOffset)) < dcThreshold) numEq++; ++ if(((unsigned)(src[ 2*step] - src[3*step] + dcOffset)) < dcThreshold) numEq++; ++ if(((unsigned)(src[ 3*step] - src[4*step] + dcOffset)) < dcThreshold) numEq++; ++ if(((unsigned)(src[ 4*step] - src[5*step] + dcOffset)) < dcThreshold) numEq++; ++ if(((unsigned)(src[ 5*step] - src[6*step] + dcOffset)) < dcThreshold) numEq++; ++ if(((unsigned)(src[ 6*step] - src[7*step] + dcOffset)) < dcThreshold) numEq++; ++ if(((unsigned)(src[ 7*step] - src[8*step] + dcOffset)) < dcThreshold) numEq++; ++ if(numEq > c->ppMode.flatnessThreshold){ ++ int min, max, x; ++ ++ if(src[0] > src[step]){ ++ max= src[0]; ++ min= src[step]; ++ }else{ ++ max= src[step]; ++ min= src[0]; ++ } ++ for(x=2; x<8; x+=2){ ++ if(src[x*step] > src[(x+1)*step]){ ++ if(src[x *step] > max) max= src[ x *step]; ++ if(src[(x+1)*step] < min) min= src[(x+1)*step]; ++ }else{ ++ if(src[(x+1)*step] > max) max= src[(x+1)*step]; ++ if(src[ x *step] < min) min= src[ x *step]; ++ } ++ } ++ if(max-min < 2*QP){ ++ const int first= ABS(src[-1*step] - src[0]) < QP ? src[-1*step] : src[0]; ++ const int last= ABS(src[8*step] - src[7*step]) < QP ? src[8*step] : src[7*step]; ++ ++ int sums[10]; ++ sums[0] = 4*first + src[0*step] + src[1*step] + src[2*step] + 4; ++ sums[1] = sums[0] - first + src[3*step]; ++ sums[2] = sums[1] - first + src[4*step]; ++ sums[3] = sums[2] - first + src[5*step]; ++ sums[4] = sums[3] - first + src[6*step]; ++ sums[5] = sums[4] - src[0*step] + src[7*step]; ++ sums[6] = sums[5] - src[1*step] + last; ++ sums[7] = sums[6] - src[2*step] + last; ++ sums[8] = sums[7] - src[3*step] + last; ++ sums[9] = sums[8] - src[4*step] + last; ++ ++ src[0*step]= (sums[0] + sums[2] + 2*src[0*step])>>4; ++ src[1*step]= (sums[1] + sums[3] + 2*src[1*step])>>4; ++ src[2*step]= (sums[2] + sums[4] + 2*src[2*step])>>4; ++ src[3*step]= (sums[3] + sums[5] + 2*src[3*step])>>4; ++ src[4*step]= (sums[4] + sums[6] + 2*src[4*step])>>4; ++ src[5*step]= (sums[5] + sums[7] + 2*src[5*step])>>4; ++ src[6*step]= (sums[6] + sums[8] + 2*src[6*step])>>4; ++ src[7*step]= (sums[7] + sums[9] + 2*src[7*step])>>4; ++ } ++ }else{ ++ const int middleEnergy= 5*(src[4*step] - src[3*step]) + 2*(src[2*step] - src[5*step]); ++ ++ if(ABS(middleEnergy) < 8*QP) ++ { ++ const int q=(src[3*step] - src[4*step])/2; ++ const int leftEnergy= 5*(src[2*step] - src[1*step]) + 2*(src[0*step] - src[3*step]); ++ const int rightEnergy= 5*(src[6*step] - src[5*step]) + 2*(src[4*step] - src[7*step]); ++ ++ int d= ABS(middleEnergy) - MIN( ABS(leftEnergy), ABS(rightEnergy) ); ++ d= MAX(d, 0); ++ ++ d= (5*d + 32) >> 6; ++ d*= SIGN(-middleEnergy); ++ ++ if(q>0) ++ { ++ d= d<0 ? 0 : d; ++ d= d>q ? q : d; ++ } ++ else ++ { ++ d= d>0 ? 0 : d; ++ d= dchrV, dstFilter->chrV, c->param); + + #ifdef HAVE_ALTIVEC +- c->vYCoeffsBank = av_malloc(sizeof (vector signed short)*c->vLumFilterSize*c->dstH); +- c->vCCoeffsBank = av_malloc(sizeof (vector signed short)*c->vChrFilterSize*c->chrDstH); ++ c->vYCoeffsBank = av_malloc(16*c->vLumFilterSize*c->dstH); ++ c->vCCoeffsBank = av_malloc(16*c->vChrFilterSize*c->chrDstH); + + for (i=0;ivLumFilterSize*c->dstH;i++) { + int j; +Index: ffmpeg-0.cvs20070307/libswscale/swscale_altivec.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ ffmpeg-0.cvs20070307/libswscale/swscale_altivec.c 2007-03-28 16:17:39.000000000 +0200 +@@ -0,0 +1,729 @@ ++/* ++ * Copyright (C) 2001-2003 Michael Niedermayer ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ * ++ * the C code (not assembly, mmx, ...) of this file can be used ++ * under the LGPL license too ++ */ ++ ++/* ++ supported Input formats: YV12, I420/IYUV, YUY2, UYVY, BGR32, BGR24, BGR16, BGR15, RGB32, RGB24, Y8/Y800, YVU9/IF09, PAL8 ++ supported output formats: YV12, I420/IYUV, YUY2, UYVY, {BGR,RGB}{1,4,8,15,16,24,32}, Y8/Y800, YVU9/IF09 ++ {BGR,RGB}{1,4,8,15,16} support dithering ++ ++ unscaled special converters (YV12=I420=IYUV, Y800=Y8) ++ YV12 -> {BGR,RGB}{1,4,8,15,16,24,32} ++ x -> x ++ YUV9 -> YV12 ++ YUV9/YV12 -> Y800 ++ Y800 -> YUV9/YV12 ++ BGR24 -> BGR32 & RGB24 -> RGB32 ++ BGR32 -> BGR24 & RGB32 -> RGB24 ++ BGR15 -> BGR16 ++*/ ++ ++/* ++tested special converters (most are tested actually but i didnt write it down ...) ++ YV12 -> BGR16 ++ YV12 -> YV12 ++ BGR15 -> BGR16 ++ BGR16 -> BGR16 ++ YVU9 -> YV12 ++ ++untested special converters ++ YV12/I420 -> BGR15/BGR24/BGR32 (its the yuv2rgb stuff, so it should be ok) ++ YV12/I420 -> YV12/I420 ++ YUY2/BGR15/BGR24/BGR32/RGB24/RGB32 -> same format ++ BGR24 -> BGR32 & RGB24 -> RGB32 ++ BGR32 -> BGR24 & RGB32 -> RGB24 ++ BGR24 -> YV12 ++*/ ++ ++#include ++#include ++#include ++#include ++#include ++#include "config.h" ++#include ++#ifdef HAVE_SYS_MMAN_H ++#include ++#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS) ++#define MAP_ANONYMOUS MAP_ANON ++#endif ++#endif ++#include "swscale.h" ++#include "swscale_internal.h" ++#include "x86_cpu.h" ++#include "bswap.h" ++#include "rgb2rgb.h" ++#ifdef USE_FASTMEMCPY ++#include "libvo/fastmemcpy.h" ++#endif ++ ++#undef MOVNTQ ++#undef PAVGB ++ ++//#undef HAVE_MMX2 ++//#define HAVE_3DNOW ++//#undef HAVE_MMX ++//#undef ARCH_X86 ++//#define WORDS_BIGENDIAN ++#define DITHER1XBPP ++ ++#define FAST_BGR2YV12 // use 7 bit coeffs instead of 15bit ++ ++#define RET 0xC3 //near return opcode for X86 ++ ++#ifdef MP_DEBUG ++#define ASSERT(x) assert(x); ++#else ++#define ASSERT(x) ; ++#endif ++ ++#ifdef M_PI ++#define PI M_PI ++#else ++#define PI 3.14159265358979323846 ++#endif ++ ++#define isSupportedIn(x) ((x)==PIX_FMT_YUV420P || (x)==PIX_FMT_YUYV422 || (x)==PIX_FMT_UYVY422\ ++ || (x)==PIX_FMT_RGB32|| (x)==PIX_FMT_BGR24|| (x)==PIX_FMT_BGR565|| (x)==PIX_FMT_BGR555\ ++ || (x)==PIX_FMT_BGR32|| (x)==PIX_FMT_RGB24|| (x)==PIX_FMT_RGB565|| (x)==PIX_FMT_RGB555\ ++ || (x)==PIX_FMT_GRAY8 || (x)==PIX_FMT_YUV410P\ ++ || (x)==PIX_FMT_GRAY16BE || (x)==PIX_FMT_GRAY16LE\ ++ || (x)==PIX_FMT_YUV444P || (x)==PIX_FMT_YUV422P || (x)==PIX_FMT_YUV411P\ ++ || (x)==PIX_FMT_PAL8 || (x)==PIX_FMT_BGR8 || (x)==PIX_FMT_RGB8\ ++ || (x)==PIX_FMT_BGR4_BYTE || (x)==PIX_FMT_RGB4_BYTE) ++#define isSupportedOut(x) ((x)==PIX_FMT_YUV420P || (x)==PIX_FMT_YUYV422 || (x)==PIX_FMT_UYVY422\ ++ || (x)==PIX_FMT_YUV444P || (x)==PIX_FMT_YUV422P || (x)==PIX_FMT_YUV411P\ ++ || isRGB(x) || isBGR(x)\ ++ || (x)==PIX_FMT_NV12 || (x)==PIX_FMT_NV21\ ++ || (x)==PIX_FMT_GRAY16BE || (x)==PIX_FMT_GRAY16LE\ ++ || (x)==PIX_FMT_GRAY8 || (x)==PIX_FMT_YUV410P) ++#define isPacked(x) ((x)==PIX_FMT_YUYV422 || (x)==PIX_FMT_UYVY422 ||isRGB(x) || isBGR(x)) ++ ++#define RGB2YUV_SHIFT 16 ++#define BY ((int)( 0.098*(1<BGR scaler ++*/ ++ ++#if defined(ARCH_X86) && defined (CONFIG_GPL) ++static uint64_t attribute_used __attribute__((aligned(8))) bF8= 0xF8F8F8F8F8F8F8F8LL; ++static uint64_t attribute_used __attribute__((aligned(8))) bFC= 0xFCFCFCFCFCFCFCFCLL; ++static uint64_t __attribute__((aligned(8))) w10= 0x0010001000100010LL; ++static uint64_t attribute_used __attribute__((aligned(8))) w02= 0x0002000200020002LL; ++static uint64_t attribute_used __attribute__((aligned(8))) bm00001111=0x00000000FFFFFFFFLL; ++static uint64_t attribute_used __attribute__((aligned(8))) bm00000111=0x0000000000FFFFFFLL; ++static uint64_t attribute_used __attribute__((aligned(8))) bm11111000=0xFFFFFFFFFF000000LL; ++static uint64_t attribute_used __attribute__((aligned(8))) bm01010101=0x00FF00FF00FF00FFLL; ++ ++static volatile uint64_t attribute_used __attribute__((aligned(8))) b5Dither; ++static volatile uint64_t attribute_used __attribute__((aligned(8))) g5Dither; ++static volatile uint64_t attribute_used __attribute__((aligned(8))) g6Dither; ++static volatile uint64_t attribute_used __attribute__((aligned(8))) r5Dither; ++ ++static uint64_t __attribute__((aligned(8))) dither4[2]={ ++ 0x0103010301030103LL, ++ 0x0200020002000200LL,}; ++ ++static uint64_t __attribute__((aligned(8))) dither8[2]={ ++ 0x0602060206020602LL, ++ 0x0004000400040004LL,}; ++ ++static uint64_t __attribute__((aligned(8))) b16Mask= 0x001F001F001F001FLL; ++static uint64_t attribute_used __attribute__((aligned(8))) g16Mask= 0x07E007E007E007E0LL; ++static uint64_t attribute_used __attribute__((aligned(8))) r16Mask= 0xF800F800F800F800LL; ++static uint64_t __attribute__((aligned(8))) b15Mask= 0x001F001F001F001FLL; ++static uint64_t attribute_used __attribute__((aligned(8))) g15Mask= 0x03E003E003E003E0LL; ++static uint64_t attribute_used __attribute__((aligned(8))) r15Mask= 0x7C007C007C007C00LL; ++ ++static uint64_t attribute_used __attribute__((aligned(8))) M24A= 0x00FF0000FF0000FFLL; ++static uint64_t attribute_used __attribute__((aligned(8))) M24B= 0xFF0000FF0000FF00LL; ++static uint64_t attribute_used __attribute__((aligned(8))) M24C= 0x0000FF0000FF0000LL; ++ ++#ifdef FAST_BGR2YV12 ++static const uint64_t bgr2YCoeff attribute_used __attribute__((aligned(8))) = 0x000000210041000DULL; ++static const uint64_t bgr2UCoeff attribute_used __attribute__((aligned(8))) = 0x0000FFEEFFDC0038ULL; ++static const uint64_t bgr2VCoeff attribute_used __attribute__((aligned(8))) = 0x00000038FFD2FFF8ULL; ++#else ++static const uint64_t bgr2YCoeff attribute_used __attribute__((aligned(8))) = 0x000020E540830C8BULL; ++static const uint64_t bgr2UCoeff attribute_used __attribute__((aligned(8))) = 0x0000ED0FDAC23831ULL; ++static const uint64_t bgr2VCoeff attribute_used __attribute__((aligned(8))) = 0x00003831D0E6F6EAULL; ++#endif /* FAST_BGR2YV12 */ ++static const uint64_t bgr2YOffset attribute_used __attribute__((aligned(8))) = 0x1010101010101010ULL; ++static const uint64_t bgr2UVOffset attribute_used __attribute__((aligned(8)))= 0x8080808080808080ULL; ++static const uint64_t w1111 attribute_used __attribute__((aligned(8))) = 0x0001000100010001ULL; ++#endif /* defined(ARCH_X86) */ ++ ++// clipping helper table for C implementations: ++static unsigned char clip_table[768]; ++ ++static SwsVector *sws_getConvVec(SwsVector *a, SwsVector *b); ++ ++extern const uint8_t dither_2x2_4[2][8]; ++extern const uint8_t dither_2x2_8[2][8]; ++extern const uint8_t dither_8x8_32[8][8]; ++extern const uint8_t dither_8x8_73[8][8]; ++extern const uint8_t dither_8x8_220[8][8]; ++ ++static const char * sws_context_to_name(void * ptr) { ++ return "swscaler"; ++} ++ ++static AVClass sws_context_class = { "SWScaler", sws_context_to_name, NULL }; ++ ++#if defined(ARCH_X86) && defined (CONFIG_GPL) ++void in_asm_used_var_warning_killer() ++{ ++ volatile int i= bF8+bFC+w10+ ++ bm00001111+bm00000111+bm11111000+b16Mask+g16Mask+r16Mask+b15Mask+g15Mask+r15Mask+ ++ M24A+M24B+M24C+w02 + b5Dither+g5Dither+r5Dither+g6Dither+dither4[0]+dither8[0]+bm01010101; ++ if(i) i=0; ++} ++#endif ++ ++static inline void yuv2yuvXinC(int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize, ++ int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, ++ uint8_t *dest, uint8_t *uDest, uint8_t *vDest, int dstW, int chrDstW) ++{ ++ //FIXME Optimize (just quickly writen not opti..) ++ int i; ++ for(i=0; i>19); ++ } ++ ++ if(uDest != NULL) ++ for(i=0; i>19); ++ vDest[i]= av_clip_uint8(v>>19); ++ } ++} ++ ++static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize, ++ int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, ++ uint8_t *dest, uint8_t *uDest, int dstW, int chrDstW, int dstFormat) ++{ ++ //FIXME Optimize (just quickly writen not opti..) ++ int i; ++ for(i=0; i>19); ++ } ++ ++ if(uDest == NULL) ++ return; ++ ++ if(dstFormat == PIX_FMT_NV12) ++ for(i=0; i>19); ++ uDest[2*i+1]= av_clip_uint8(v>>19); ++ } ++ else ++ for(i=0; i>19); ++ uDest[2*i+1]= av_clip_uint8(u>>19); ++ } ++} ++ ++#define YSCALE_YUV_2_PACKEDX_C(type) \ ++ for(i=0; i<(dstW>>1); i++){\ ++ int j;\ ++ int Y1=1<<18;\ ++ int Y2=1<<18;\ ++ int U=1<<18;\ ++ int V=1<<18;\ ++ type attribute_unused *r, *b, *g;\ ++ const int i2= 2*i;\ ++ \ ++ for(j=0; j>=19;\ ++ Y2>>=19;\ ++ U >>=19;\ ++ V >>=19;\ ++ if((Y1|Y2|U|V)&256)\ ++ {\ ++ if(Y1>255) Y1=255;\ ++ else if(Y1<0)Y1=0;\ ++ if(Y2>255) Y2=255;\ ++ else if(Y2<0)Y2=0;\ ++ if(U>255) U=255;\ ++ else if(U<0) U=0;\ ++ if(V>255) V=255;\ ++ else if(V<0) V=0;\ ++ } ++ ++#define YSCALE_YUV_2_RGBX_C(type) \ ++ YSCALE_YUV_2_PACKEDX_C(type)\ ++ r = (type *)c->table_rV[V];\ ++ g = (type *)(c->table_gU[U] + c->table_gV[V]);\ ++ b = (type *)c->table_bU[U];\ ++ ++#define YSCALE_YUV_2_PACKED2_C \ ++ for(i=0; i<(dstW>>1); i++){\ ++ const int i2= 2*i;\ ++ int Y1= (buf0[i2 ]*yalpha1+buf1[i2 ]*yalpha)>>19;\ ++ int Y2= (buf0[i2+1]*yalpha1+buf1[i2+1]*yalpha)>>19;\ ++ int U= (uvbuf0[i ]*uvalpha1+uvbuf1[i ]*uvalpha)>>19;\ ++ int V= (uvbuf0[i+2048]*uvalpha1+uvbuf1[i+2048]*uvalpha)>>19;\ ++ ++#define YSCALE_YUV_2_RGB2_C(type) \ ++ YSCALE_YUV_2_PACKED2_C\ ++ type *r, *b, *g;\ ++ r = (type *)c->table_rV[V];\ ++ g = (type *)(c->table_gU[U] + c->table_gV[V]);\ ++ b = (type *)c->table_bU[U];\ ++ ++#define YSCALE_YUV_2_PACKED1_C \ ++ for(i=0; i<(dstW>>1); i++){\ ++ const int i2= 2*i;\ ++ int Y1= buf0[i2 ]>>7;\ ++ int Y2= buf0[i2+1]>>7;\ ++ int U= (uvbuf1[i ])>>7;\ ++ int V= (uvbuf1[i+2048])>>7;\ ++ ++#define YSCALE_YUV_2_RGB1_C(type) \ ++ YSCALE_YUV_2_PACKED1_C\ ++ type *r, *b, *g;\ ++ r = (type *)c->table_rV[V];\ ++ g = (type *)(c->table_gU[U] + c->table_gV[V]);\ ++ b = (type *)c->table_bU[U];\ ++ ++#define YSCALE_YUV_2_PACKED1B_C \ ++ for(i=0; i<(dstW>>1); i++){\ ++ const int i2= 2*i;\ ++ int Y1= buf0[i2 ]>>7;\ ++ int Y2= buf0[i2+1]>>7;\ ++ int U= (uvbuf0[i ] + uvbuf1[i ])>>8;\ ++ int V= (uvbuf0[i+2048] + uvbuf1[i+2048])>>8;\ ++ ++#define YSCALE_YUV_2_RGB1B_C(type) \ ++ YSCALE_YUV_2_PACKED1B_C\ ++ type *r, *b, *g;\ ++ r = (type *)c->table_rV[V];\ ++ g = (type *)(c->table_gU[U] + c->table_gV[V]);\ ++ b = (type *)c->table_bU[U];\ ++ ++#define YSCALE_YUV_2_ANYRGB_C(func, func2)\ ++ switch(c->dstFormat)\ ++ {\ ++ case PIX_FMT_RGB32:\ ++ case PIX_FMT_BGR32:\ ++ func(uint32_t)\ ++ ((uint32_t*)dest)[i2+0]= r[Y1] + g[Y1] + b[Y1];\ ++ ((uint32_t*)dest)[i2+1]= r[Y2] + g[Y2] + b[Y2];\ ++ } \ ++ break;\ ++ case PIX_FMT_RGB24:\ ++ func(uint8_t)\ ++ ((uint8_t*)dest)[0]= r[Y1];\ ++ ((uint8_t*)dest)[1]= g[Y1];\ ++ ((uint8_t*)dest)[2]= b[Y1];\ ++ ((uint8_t*)dest)[3]= r[Y2];\ ++ ((uint8_t*)dest)[4]= g[Y2];\ ++ ((uint8_t*)dest)[5]= b[Y2];\ ++ dest+=6;\ ++ }\ ++ break;\ ++ case PIX_FMT_BGR24:\ ++ func(uint8_t)\ ++ ((uint8_t*)dest)[0]= b[Y1];\ ++ ((uint8_t*)dest)[1]= g[Y1];\ ++ ((uint8_t*)dest)[2]= r[Y1];\ ++ ((uint8_t*)dest)[3]= b[Y2];\ ++ ((uint8_t*)dest)[4]= g[Y2];\ ++ ((uint8_t*)dest)[5]= r[Y2];\ ++ dest+=6;\ ++ }\ ++ break;\ ++ case PIX_FMT_RGB565:\ ++ case PIX_FMT_BGR565:\ ++ {\ ++ const int dr1= dither_2x2_8[y&1 ][0];\ ++ const int dg1= dither_2x2_4[y&1 ][0];\ ++ const int db1= dither_2x2_8[(y&1)^1][0];\ ++ const int dr2= dither_2x2_8[y&1 ][1];\ ++ const int dg2= dither_2x2_4[y&1 ][1];\ ++ const int db2= dither_2x2_8[(y&1)^1][1];\ ++ func(uint16_t)\ ++ ((uint16_t*)dest)[i2+0]= r[Y1+dr1] + g[Y1+dg1] + b[Y1+db1];\ ++ ((uint16_t*)dest)[i2+1]= r[Y2+dr2] + g[Y2+dg2] + b[Y2+db2];\ ++ }\ ++ }\ ++ break;\ ++ case PIX_FMT_RGB555:\ ++ case PIX_FMT_BGR555:\ ++ {\ ++ const int dr1= dither_2x2_8[y&1 ][0];\ ++ const int dg1= dither_2x2_8[y&1 ][1];\ ++ const int db1= dither_2x2_8[(y&1)^1][0];\ ++ const int dr2= dither_2x2_8[y&1 ][1];\ ++ const int dg2= dither_2x2_8[y&1 ][0];\ ++ const int db2= dither_2x2_8[(y&1)^1][1];\ ++ func(uint16_t)\ ++ ((uint16_t*)dest)[i2+0]= r[Y1+dr1] + g[Y1+dg1] + b[Y1+db1];\ ++ ((uint16_t*)dest)[i2+1]= r[Y2+dr2] + g[Y2+dg2] + b[Y2+db2];\ ++ }\ ++ }\ ++ break;\ ++ case PIX_FMT_RGB8:\ ++ case PIX_FMT_BGR8:\ ++ {\ ++ const uint8_t * const d64= dither_8x8_73[y&7];\ ++ const uint8_t * const d32= dither_8x8_32[y&7];\ ++ func(uint8_t)\ ++ ((uint8_t*)dest)[i2+0]= r[Y1+d32[(i2+0)&7]] + g[Y1+d32[(i2+0)&7]] + b[Y1+d64[(i2+0)&7]];\ ++ ((uint8_t*)dest)[i2+1]= r[Y2+d32[(i2+1)&7]] + g[Y2+d32[(i2+1)&7]] + b[Y2+d64[(i2+1)&7]];\ ++ }\ ++ }\ ++ break;\ ++ case PIX_FMT_RGB4:\ ++ case PIX_FMT_BGR4:\ ++ {\ ++ const uint8_t * const d64= dither_8x8_73 [y&7];\ ++ const uint8_t * const d128=dither_8x8_220[y&7];\ ++ func(uint8_t)\ ++ ((uint8_t*)dest)[i]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]]\ ++ + ((r[Y2+d128[(i2+1)&7]] + g[Y2+d64[(i2+1)&7]] + b[Y2+d128[(i2+1)&7]])<<4);\ ++ }\ ++ }\ ++ break;\ ++ case PIX_FMT_RGB4_BYTE:\ ++ case PIX_FMT_BGR4_BYTE:\ ++ {\ ++ const uint8_t * const d64= dither_8x8_73 [y&7];\ ++ const uint8_t * const d128=dither_8x8_220[y&7];\ ++ func(uint8_t)\ ++ ((uint8_t*)dest)[i2+0]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]];\ ++ ((uint8_t*)dest)[i2+1]= r[Y2+d128[(i2+1)&7]] + g[Y2+d64[(i2+1)&7]] + b[Y2+d128[(i2+1)&7]];\ ++ }\ ++ }\ ++ break;\ ++ case PIX_FMT_MONOBLACK:\ ++ {\ ++ const uint8_t * const d128=dither_8x8_220[y&7];\ ++ uint8_t *g= c->table_gU[128] + c->table_gV[128];\ ++ for(i=0; i>19) + d128[0]];\ ++ acc+= acc + g[((buf0[i+1]*yalpha1+buf1[i+1]*yalpha)>>19) + d128[1]];\ ++ acc+= acc + g[((buf0[i+2]*yalpha1+buf1[i+2]*yalpha)>>19) + d128[2]];\ ++ acc+= acc + g[((buf0[i+3]*yalpha1+buf1[i+3]*yalpha)>>19) + d128[3]];\ ++ acc+= acc + g[((buf0[i+4]*yalpha1+buf1[i+4]*yalpha)>>19) + d128[4]];\ ++ acc+= acc + g[((buf0[i+5]*yalpha1+buf1[i+5]*yalpha)>>19) + d128[5]];\ ++ acc+= acc + g[((buf0[i+6]*yalpha1+buf1[i+6]*yalpha)>>19) + d128[6]];\ ++ acc+= acc + g[((buf0[i+7]*yalpha1+buf1[i+7]*yalpha)>>19) + d128[7]];\ ++ ((uint8_t*)dest)[0]= acc;\ ++ dest++;\ ++ }\ ++\ ++/*\ ++((uint8_t*)dest)-= dstW>>4;\ ++{\ ++ int acc=0;\ ++ int left=0;\ ++ static int top[1024];\ ++ static int last_new[1024][1024];\ ++ static int last_in3[1024][1024];\ ++ static int drift[1024][1024];\ ++ int topLeft=0;\ ++ int shift=0;\ ++ int count=0;\ ++ const uint8_t * const d128=dither_8x8_220[y&7];\ ++ int error_new=0;\ ++ int error_in3=0;\ ++ int f=0;\ ++ \ ++ for(i=dstW>>1; i>19);\ ++ int in2 = (76309 * (in - 16) + 32768) >> 16;\ ++ int in3 = (in2 < 0) ? 0 : ((in2 > 255) ? 255 : in2);\ ++ int old= (left*7 + topLeft + top[i]*5 + top[i+1]*3)/20 + in3\ ++ + (last_new[y][i] - in3)*f/256;\ ++ int new= old> 128 ? 255 : 0;\ ++\ ++ error_new+= FFABS(last_new[y][i] - new);\ ++ error_in3+= FFABS(last_in3[y][i] - in3);\ ++ f= error_new - error_in3*4;\ ++ if(f<0) f=0;\ ++ if(f>256) f=256;\ ++\ ++ topLeft= top[i];\ ++ left= top[i]= old - new;\ ++ last_new[y][i]= new;\ ++ last_in3[y][i]= in3;\ ++\ ++ acc+= acc + (new&1);\ ++ if((i&7)==6){\ ++ ((uint8_t*)dest)[0]= acc;\ ++ ((uint8_t*)dest)++;\ ++ }\ ++ }\ ++}\ ++*/\ ++ }\ ++ break;\ ++ case PIX_FMT_YUYV422:\ ++ func2\ ++ ((uint8_t*)dest)[2*i2+0]= Y1;\ ++ ((uint8_t*)dest)[2*i2+1]= U;\ ++ ((uint8_t*)dest)[2*i2+2]= Y2;\ ++ ((uint8_t*)dest)[2*i2+3]= V;\ ++ } \ ++ break;\ ++ case PIX_FMT_UYVY422:\ ++ func2\ ++ ((uint8_t*)dest)[2*i2+0]= U;\ ++ ((uint8_t*)dest)[2*i2+1]= Y1;\ ++ ((uint8_t*)dest)[2*i2+2]= V;\ ++ ((uint8_t*)dest)[2*i2+3]= Y2;\ ++ } \ ++ break;\ ++ }\ ++ ++ ++static inline void yuv2packedXinC(SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize, ++ int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, ++ uint8_t *dest, int dstW, int y) ++{ ++ int i; ++ switch(c->dstFormat) ++ { ++ case PIX_FMT_BGR32: ++ case PIX_FMT_RGB32: ++ YSCALE_YUV_2_RGBX_C(uint32_t) ++ ((uint32_t*)dest)[i2+0]= r[Y1] + g[Y1] + b[Y1]; ++ ((uint32_t*)dest)[i2+1]= r[Y2] + g[Y2] + b[Y2]; ++ } ++ break; ++ case PIX_FMT_RGB24: ++ YSCALE_YUV_2_RGBX_C(uint8_t) ++ ((uint8_t*)dest)[0]= r[Y1]; ++ ((uint8_t*)dest)[1]= g[Y1]; ++ ((uint8_t*)dest)[2]= b[Y1]; ++ ((uint8_t*)dest)[3]= r[Y2]; ++ ((uint8_t*)dest)[4]= g[Y2]; ++ ((uint8_t*)dest)[5]= b[Y2]; ++ dest+=6; ++ } ++ break; ++ case PIX_FMT_BGR24: ++ YSCALE_YUV_2_RGBX_C(uint8_t) ++ ((uint8_t*)dest)[0]= b[Y1]; ++ ((uint8_t*)dest)[1]= g[Y1]; ++ ((uint8_t*)dest)[2]= r[Y1]; ++ ((uint8_t*)dest)[3]= b[Y2]; ++ ((uint8_t*)dest)[4]= g[Y2]; ++ ((uint8_t*)dest)[5]= r[Y2]; ++ dest+=6; ++ } ++ break; ++ case PIX_FMT_RGB565: ++ case PIX_FMT_BGR565: ++ { ++ const int dr1= dither_2x2_8[y&1 ][0]; ++ const int dg1= dither_2x2_4[y&1 ][0]; ++ const int db1= dither_2x2_8[(y&1)^1][0]; ++ const int dr2= dither_2x2_8[y&1 ][1]; ++ const int dg2= dither_2x2_4[y&1 ][1]; ++ const int db2= dither_2x2_8[(y&1)^1][1]; ++ YSCALE_YUV_2_RGBX_C(uint16_t) ++ ((uint16_t*)dest)[i2+0]= r[Y1+dr1] + g[Y1+dg1] + b[Y1+db1]; ++ ((uint16_t*)dest)[i2+1]= r[Y2+dr2] + g[Y2+dg2] + b[Y2+db2]; ++ } ++ } ++ break; ++ case PIX_FMT_RGB555: ++ case PIX_FMT_BGR555: ++ { ++ const int dr1= dither_2x2_8[y&1 ][0]; ++ const int dg1= dither_2x2_8[y&1 ][1]; ++ const int db1= dither_2x2_8[(y&1)^1][0]; ++ const int dr2= dither_2x2_8[y&1 ][1]; ++ const int dg2= dither_2x2_8[y&1 ][0]; ++ const int db2= dither_2x2_8[(y&1)^1][1]; ++ YSCALE_YUV_2_RGBX_C(uint16_t) ++ ((uint16_t*)dest)[i2+0]= r[Y1+dr1] + g[Y1+dg1] + b[Y1+db1]; ++ ((uint16_t*)dest)[i2+1]= r[Y2+dr2] + g[Y2+dg2] + b[Y2+db2]; ++ } ++ } ++ break; ++ case PIX_FMT_RGB8: ++ case PIX_FMT_BGR8: ++ { ++ const uint8_t * const d64= dither_8x8_73[y&7]; ++ const uint8_t * const d32= dither_8x8_32[y&7]; ++ YSCALE_YUV_2_RGBX_C(uint8_t) ++ ((uint8_t*)dest)[i2+0]= r[Y1+d32[(i2+0)&7]] + g[Y1+d32[(i2+0)&7]] + b[Y1+d64[(i2+0)&7]]; ++ ((uint8_t*)dest)[i2+1]= r[Y2+d32[(i2+1)&7]] + g[Y2+d32[(i2+1)&7]] + b[Y2+d64[(i2+1)&7]]; ++ } ++ } ++ break; ++ case PIX_FMT_RGB4: ++ case PIX_FMT_BGR4: ++ { ++ const uint8_t * const d64= dither_8x8_73 [y&7]; ++ const uint8_t * const d128=dither_8x8_220[y&7]; ++ YSCALE_YUV_2_RGBX_C(uint8_t) ++ ((uint8_t*)dest)[i]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]] ++ +((r[Y2+d128[(i2+1)&7]] + g[Y2+d64[(i2+1)&7]] + b[Y2+d128[(i2+1)&7]])<<4); ++ } ++ } ++ break; ++ case PIX_FMT_RGB4_BYTE: ++ case PIX_FMT_BGR4_BYTE: ++ { ++ const uint8_t * const d64= dither_8x8_73 [y&7]; ++ const uint8_t * const d128=dither_8x8_220[y&7]; ++ YSCALE_YUV_2_RGBX_C(uint8_t) ++ ((uint8_t*)dest)[i2+0]= r[Y1+d128[(i2+0)&7]] + g[Y1+d64[(i2+0)&7]] + b[Y1+d128[(i2+0)&7]]; ++ ((uint8_t*)dest)[i2+1]= r[Y2+d128[(i2+1)&7]] + g[Y2+d64[(i2+1)&7]] + b[Y2+d128[(i2+1)&7]]; ++ } ++ } ++ break; ++ case PIX_FMT_MONOBLACK: ++ { ++ const uint8_t * const d128=dither_8x8_220[y&7]; ++ uint8_t *g= c->table_gU[128] + c->table_gV[128]; ++ int acc=0; ++ for(i=0; i>=19; ++ Y2>>=19; ++ if((Y1|Y2)&256) ++ { ++ if(Y1>255) Y1=255; ++ else if(Y1<0)Y1=0; ++ if(Y2>255) Y2=255; ++ else if(Y2<0)Y2=0; ++ } ++ acc+= acc + g[Y1+d128[(i+0)&7]]; ++ acc+= acc + g[Y2+d128[(i+1)&7]]; ++ if((i&7)==6){ ++ ((uint8_t*)dest)[0]= acc; ++ dest++; ++ } ++ } ++ } ++ break; ++ case PIX_FMT_YUYV422: ++ YSCALE_YUV_2_PACKEDX_C(void) ++ ((uint8_t*)dest)[2*i2+0]= Y1; ++ ((uint8_t*)dest)[2*i2+1]= U; ++ ((uint8_t*)dest)[2*i2+2]= Y2; ++ ((uint8_t*)dest)[2*i2+3]= V; ++ } ++ break; ++ case PIX_FMT_UYVY422: ++ YSCALE_YUV_2_PACKEDX_C(void) ++ ((uint8_t*)dest)[2*i2+0]= U; ++ ((uint8_t*)dest)[2*i2+1]= Y1; ++ ((uint8_t*)dest)[2*i2+2]= V; ++ ((uint8_t*)dest)[2*i2+3]= Y2; ++ } ++ break; ++ } ++} ++ ++ ++#undef RENAME ++#define HAVE_ALTIVEC ++#define RENAME(a) a ## _altivec ++#include "swscale_template.c" ++ +Index: ffmpeg-0.cvs20070307/libswscale/swscale_altivec_template.c +=================================================================== +--- ffmpeg-0.cvs20070307.orig/libswscale/swscale_altivec_template.c 2007-03-07 14:37:07.000000000 +0100 ++++ ffmpeg-0.cvs20070307/libswscale/swscale_altivec_template.c 2007-03-28 16:17:39.000000000 +0200 +@@ -390,7 +390,7 @@ + } + } + +-static inline int yv12toyuy2_unscaled_altivec(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, ++int yv12toyuy2_unscaled_altivec(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, + int srcSliceH, uint8_t* dstParam[], int dstStride_a[]) { + uint8_t *dst=dstParam[0] + dstStride_a[0]*srcSliceY; + // yv12toyuy2( src[0],src[1],src[2],dst,c->srcW,srcSliceH,srcStride[0],srcStride[1],dstStride[0] ); +@@ -469,7 +469,7 @@ + return srcSliceH; + } + +-static inline int yv12touyvy_unscaled_altivec(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, ++int yv12touyvy_unscaled_altivec(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, + int srcSliceH, uint8_t* dstParam[], int dstStride_a[]) { + uint8_t *dst=dstParam[0] + dstStride_a[0]*srcSliceY; + // yv12toyuy2( src[0],src[1],src[2],dst,c->srcW,srcSliceH,srcStride[0],srcStride[1],dstStride[0] ); +Index: ffmpeg-0.cvs20070307/libswscale/swscale_internal.h +=================================================================== +--- ffmpeg-0.cvs20070307.orig/libswscale/swscale_internal.h 2007-03-07 14:37:07.000000000 +0100 ++++ ffmpeg-0.cvs20070307/libswscale/swscale_internal.h 2007-03-28 16:17:39.000000000 +0200 +@@ -21,9 +21,11 @@ + #ifndef SWSCALE_INTERNAL_H + #define SWSCALE_INTERNAL_H + ++#ifdef ABI_ALTIVEC + #ifdef HAVE_ALTIVEC_H + #include + #endif ++#endif + + #include "avutil.h" + +@@ -150,15 +152,20 @@ + uint64_t v_temp __attribute__((aligned(8))); + + #ifdef HAVE_ALTIVEC ++#ifdef ABI_ALTIVEC ++#define VEC(x) vector x ++#else ++#define VEC(x) union { char c[16]; } ++#endif + +- vector signed short CY; +- vector signed short CRV; +- vector signed short CBU; +- vector signed short CGU; +- vector signed short CGV; +- vector signed short OY; +- vector unsigned short CSHIFT; +- vector signed short *vYCoeffsBank, *vCCoeffsBank; ++ VEC(signed short) CY; ++ VEC(signed short) CRV; ++ VEC(signed short) CBU; ++ VEC(signed short) CGU; ++ VEC(signed short) CGV; ++ VEC(signed short) OY; ++ VEC(unsigned short) CSHIFT; ++ VEC(signed short) *vYCoeffsBank, *vCCoeffsBank; + + #endif + +Index: ffmpeg-0.cvs20070307/libswscale/Makefile +=================================================================== +--- ffmpeg-0.cvs20070307.orig/libswscale/Makefile 2007-03-07 14:37:07.000000000 +0100 ++++ ffmpeg-0.cvs20070307/libswscale/Makefile 2007-03-28 16:17:39.000000000 +0200 +@@ -9,8 +9,10 @@ + + OBJS= swscale.o rgb2rgb.o + +-OBJS-$(TARGET_ALTIVEC) += yuv2rgb_altivec.o ++OBJS-$(TARGET_ALTIVEC) += swscale_altivec.o yuv2rgb_altivec.o + OBJS-$(CONFIG_GPL) += yuv2rgb.o ++swscale_altivec.o: CFLAGS+= $(ALTIVECFLAGS) -DABI_ALTIVEC ++yuv2rgb_altivec.o: CFLAGS+= $(ALTIVECFLAGS) -DABI_ALTIVEC + + HEADERS = swscale.h rgb2rgb.h + +Index: ffmpeg-0.cvs20070307/libswscale/swscale_template.c +=================================================================== +--- ffmpeg-0.cvs20070307.orig/libswscale/swscale_template.c 2007-03-07 14:37:07.000000000 +0100 ++++ ffmpeg-0.cvs20070307/libswscale/swscale_template.c 2007-03-28 16:17:39.000000000 +0200 +@@ -2936,7 +2936,10 @@ + } + } + +-static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, ++#ifndef HAVE_ALTIVEC ++static ++#endif ++int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, + int srcSliceH, uint8_t* dst[], int dstStride[]){ + + /* load a few things into local vars to make the code more readable? and faster */ --- ffmpeg-0.cvs20070307.orig/debian/patches/011_link_plugins.diff +++ ffmpeg-0.cvs20070307/debian/patches/011_link_plugins.diff @@ -0,0 +1,28 @@ +Index: ffmpeg-0.cvs20070307/vhook/Makefile +=================================================================== +--- ffmpeg-0.cvs20070307.orig/vhook/Makefile 2007-03-09 15:15:49.000000000 +0100 ++++ ffmpeg-0.cvs20070307/vhook/Makefile 2007-03-09 15:42:19.000000000 +0100 +@@ -9,16 +9,21 @@ + HOOKS=null$(SLIBSUF) fish$(SLIBSUF) ppm$(SLIBSUF) watermark$(SLIBSUF) + ALLHOOKS=$(HOOKS) imlib2$(SLIBSUF) drawtext$(SLIBSUF) + ++LIBS_fish$(SLIBSUF) += -lavcodec -lswscale -lavformat ++LIBS_null$(SLIBSUF) += -lavcodec -lswscale ++LIBS_ppm$(SLIBSUF) += -lavcodec -lswscale -lavformat ++LIBS_watermark$(SLIBSUF) += -lavcodec -lswscale -lavformat ++ + ifeq ($(HAVE_IMLIB2),yes) + HOOKS += imlib2$(SLIBSUF) + CFLAGS += `imlib2-config --cflags` +- LIBS_imlib2$(SLIBSUF) = `imlib2-config --libs` ++ LIBS_imlib2$(SLIBSUF) = `imlib2-config --libs` -lswscale -lavcodec + endif + + ifeq ($(HAVE_FREETYPE2),yes) + HOOKS += drawtext$(SLIBSUF) + CFLAGS += `freetype-config --cflags` +- LIBS_drawtext$(SLIBSUF) = `freetype-config --libs` ++ LIBS_drawtext$(SLIBSUF) = `freetype-config --libs` -lavutil + endif + + SRCS := $(HOOKS:$(SLIBSUF)=.c) --- ffmpeg-0.cvs20070307.orig/debian/patches/060_fix_avi_skip.diff +++ ffmpeg-0.cvs20070307/debian/patches/060_fix_avi_skip.diff @@ -0,0 +1,12 @@ +--- ffmpeg-0.cvs20060329.orig/libavformat/avidec.c ++++ ffmpeg-0.cvs20060329/libavformat/avidec.c +@@ -594,7 +594,8 @@ + + if (i >= avi->movi_end) { + if (avi->is_odml) { +- url_fskip(pb, avi->riff_end - i); ++ if (i < avi->riff_end) ++ url_fskip(pb, avi->riff_end - i); + avi->riff_end = avi->movi_end = url_fsize(pb); + } else + break; --- ffmpeg-0.cvs20070307.orig/debian/patches/061_fix_resample_warnings.diff +++ ffmpeg-0.cvs20070307/debian/patches/061_fix_resample_warnings.diff @@ -0,0 +1,24 @@ +--- ffmpeg-0.cvs20070307.orig/libavcodec/avcodec.h 2007-03-07 14:37:04.000000000 +0100 ++++ ffmpeg-0.cvs20070307/libavcodec/avcodec.h 2007-08-06 20:40:11.000000000 +0200 +@@ -2421,7 +2421,7 @@ + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) + /* YUV420 format is assumed ! */ + +-struct ImgReSampleContext attribute_deprecated; ++struct ImgReSampleContext; + + typedef struct ImgReSampleContext ImgReSampleContext attribute_deprecated; + +@@ -2436,10 +2436,10 @@ + int padleft, int padright); + + +-attribute_deprecated void img_resample(ImgReSampleContext *s, ++attribute_deprecated void img_resample(struct ImgReSampleContext *s, + AVPicture *output, const AVPicture *input); + +-attribute_deprecated void img_resample_close(ImgReSampleContext *s); ++attribute_deprecated void img_resample_close(struct ImgReSampleContext *s); + + #endif + --- ffmpeg-0.cvs20070307.orig/debian/patches/006_mips_pthreads.diff +++ ffmpeg-0.cvs20070307/debian/patches/006_mips_pthreads.diff @@ -0,0 +1,15 @@ +Index: ffmpeg.svn/configure +=================================================================== +--- ffmpeg.svn.orig/configure 2007-03-05 20:57:37.000000000 +0100 ++++ ffmpeg.svn/configure 2007-03-05 20:57:39.000000000 +0100 +@@ -1551,6 +1551,10 @@ + # check for some common methods of building with pthread support + # do this before the optional library checks as some of them require pthreads + if enabled pthreads; then ++ if test "$targetos" = "Linux" -a \ ++ "$cpu" = "mips" ; then ++ add_ldflags -lpthread ++ fi + if check_func pthread_create; then + : + elif check_func pthread_create -pthread; then --- ffmpeg-0.cvs20070307.orig/debian/patches/101_security_CVE-2008-4867.diff +++ ffmpeg-0.cvs20070307/debian/patches/101_security_CVE-2008-4867.diff @@ -0,0 +1,18 @@ +# +# Description: fix buffer overflow caused by an incorrect DCA_MAX_FRAME_SIZE value +# Patch: http://git.ffmpeg.org/?p=ffmpeg;a=commit;h=a1a12db633cf8e9152a2f497aa3814cc78383f6d +# Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=504977 +# Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=496612 +# +diff -Nur ffmpeg-0.cvs20070307/libavcodec/dca.c ffmpeg-0.cvs20070307.new/libavcodec/dca.c +--- ffmpeg-0.cvs20070307/libavcodec/dca.c 2007-03-07 08:37:04.000000000 -0500 ++++ ffmpeg-0.cvs20070307.new/libavcodec/dca.c 2009-03-13 13:02:08.000000000 -0400 +@@ -77,7 +77,7 @@ + #define HEADER_SIZE 14 + #define CONVERT_BIAS 384 + +-#define DCA_MAX_FRAME_SIZE 16383 ++#define DCA_MAX_FRAME_SIZE 16384 + + /** Bit allocation */ + typedef struct { --- ffmpeg-0.cvs20070307.orig/debian/patches/020_mmx_pic_code.diff +++ ffmpeg-0.cvs20070307/debian/patches/020_mmx_pic_code.diff @@ -0,0 +1,172 @@ +Index: ffmpeg-0.cvs20060724/libavcodec/i386/mpegvideo_mmx_template.c +=================================================================== +--- ffmpeg-0.cvs20060724.orig/libavcodec/i386/mpegvideo_mmx_template.c 2006-07-24 17:11:17.000000000 +0200 ++++ ffmpeg-0.cvs20060724/libavcodec/i386/mpegvideo_mmx_template.c 2006-07-24 17:22:08.000000000 +0200 +@@ -108,7 +108,12 @@ + SPREADW(%%mm3) + "pxor %%mm7, %%mm7 \n\t" // 0 + "pxor %%mm4, %%mm4 \n\t" // 0 ++#if defined(PIC) && !defined(ARCH_X86_64) ++ "movl %2, %%"REG_a" \n\t" ++ "movq (%%"REG_a"), %%mm5 \n\t" // qmat[0] ++#else + "movq (%2), %%mm5 \n\t" // qmat[0] ++#endif + "pxor %%mm6, %%mm6 \n\t" + "psubw (%3), %%mm6 \n\t" // -bias[0] + "mov $-128, %%"REG_a" \n\t" +@@ -136,7 +141,11 @@ + "movd %%mm3, %%"REG_a" \n\t" + "movzb %%al, %%"REG_a" \n\t" // last_non_zero_p1 + : "+a" (last_non_zero_p1) ++#if defined(PIC) && !defined(ARCH_X86_64) ++ : "r" (block+64), "m" (qmat), "r" (bias), ++#else + : "r" (block+64), "r" (qmat), "r" (bias), ++#endif + "r" (inv_zigzag_direct16+64), "r" (temp_block+64) + ); + // note the asm is split cuz gcc doesnt like that many operands ... +@@ -150,6 +159,7 @@ + : "g" (s->max_qcoeff) + ); + }else{ // FMT_H263 ++ const uint16_t *qmat_64 = qmat + 64; + asm volatile( + "movd %%"REG_a", %%mm3 \n\t" // last_non_zero_p1 + SPREADW(%%mm3) +@@ -165,7 +175,13 @@ + "psubw %%mm1, %%mm0 \n\t" // ABS(block[i]) + "movq (%3, %%"REG_a"), %%mm6 \n\t" // bias[0] + "paddusw %%mm6, %%mm0 \n\t" // ABS(block[i]) + bias[0] ++#if defined(PIC) && !defined(ARCH_X86_64) ++ "addl %2, %%"REG_a" \n\t" ++ "movq (%%"REG_a"), %%mm5 \n\t" // qmat[i] ++ "subl %2, %%"REG_a" \n\t" ++#else + "movq (%2, %%"REG_a"), %%mm5 \n\t" // qmat[i] ++#endif + "pmulhw %%mm5, %%mm0 \n\t" // (ABS(block[i])*qmat[0] + bias[0]*qmat[0])>>16 + "por %%mm0, %%mm4 \n\t" + "pxor %%mm1, %%mm0 \n\t" +@@ -182,7 +198,11 @@ + "movd %%mm3, %%"REG_a" \n\t" + "movzb %%al, %%"REG_a" \n\t" // last_non_zero_p1 + : "+a" (last_non_zero_p1) ++#if defined(PIC) && !defined(ARCH_X86_64) ++ : "r" (block+64), "m" (qmat_64), "r" (bias+64), ++#else + : "r" (block+64), "r" (qmat+64), "r" (bias+64), ++#endif + "r" (inv_zigzag_direct16+64), "r" (temp_block+64) + ); + // note the asm is split cuz gcc doesnt like that many operands ... +Index: ffmpeg-0.cvs20060724/libpostproc/postprocess_template.c +=================================================================== +--- ffmpeg-0.cvs20060724.orig/libpostproc/postprocess_template.c 2006-06-11 14:17:36.000000000 +0200 ++++ ffmpeg-0.cvs20060724/libpostproc/postprocess_template.c 2006-07-24 17:22:08.000000000 +0200 +@@ -33,9 +33,11 @@ + # define ALIGN_MASK "$0xFFFFFFFFFFFFFFF8" + #else + # define REGa eax ++# define REGb ebx + # define REGc ecx + # define REGd edx + # define REG_a "eax" ++# define REG_b "ebx" + # define REG_c "ecx" + # define REG_d "edx" + # define REG_SP "esp" +@@ -3201,7 +3203,12 @@ + "movq (%%"REG_a"), %%mm2 \n\t" // packedYOffset + "movq 8(%%"REG_a"), %%mm3 \n\t" // packedYScale + "lea (%2,%4), %%"REG_a" \n\t" ++#if defined(PIC) && !defined(ARCH_X86_64) ++ "push %%"REG_b" \n\t" ++ "lea (%3,%5), %%"REG_b" \n\t" ++#else + "lea (%3,%5), %%"REG_d" \n\t" ++#endif + "pxor %%mm4, %%mm4 \n\t" + #ifdef HAVE_MMX2 + #define REAL_SCALED_CPY(src1, src2, dst1, dst2) \ +@@ -3257,12 +3264,22 @@ + #define SCALED_CPY(src1, src2, dst1, dst2)\ + REAL_SCALED_CPY(src1, src2, dst1, dst2) + ++#if defined(PIC) && !defined(ARCH_X86_64) ++SCALED_CPY((%2) , (%2, %4) , (%3) , (%3, %5)) ++SCALED_CPY((%2, %4, 2), (%%REGa, %4, 2), (%3, %5, 2), (%%REGb, %5, 2)) ++SCALED_CPY((%2, %4, 4), (%%REGa, %4, 4), (%3, %5, 4), (%%REGb, %5, 4)) ++ "lea (%%"REG_a",%4,4), %%"REG_a" \n\t" ++ "lea (%%"REG_b",%5,4), %%"REG_b" \n\t" ++SCALED_CPY((%%REGa, %4), (%%REGa, %4, 2), (%%REGb, %5), (%%REGb, %5, 2)) ++ "pop %%"REG_b" \n\t" ++#else + SCALED_CPY((%2) , (%2, %4) , (%3) , (%3, %5)) + SCALED_CPY((%2, %4, 2), (%%REGa, %4, 2), (%3, %5, 2), (%%REGd, %5, 2)) + SCALED_CPY((%2, %4, 4), (%%REGa, %4, 4), (%3, %5, 4), (%%REGd, %5, 4)) + "lea (%%"REG_a",%4,4), %%"REG_a" \n\t" + "lea (%%"REG_d",%5,4), %%"REG_d" \n\t" + SCALED_CPY((%%REGa, %4), (%%REGa, %4, 2), (%%REGd, %5), (%%REGd, %5, 2)) ++#endif + + + : "=&a" (packedOffsetAndScale) +@@ -3271,7 +3288,10 @@ + "r"(dst), + "r" ((long)srcStride), + "r" ((long)dstStride) ++#if defined(PIC) && !defined(ARCH_X86_64) ++#else + : "%"REG_d ++#endif + ); + #else //HAVE_MMX + for(i=0; i<8; i++) +@@ -3284,7 +3304,12 @@ + #ifdef HAVE_MMX + asm volatile( + "lea (%0,%2), %%"REG_a" \n\t" ++#if defined(PIC) && !defined(ARCH_X86_64) ++ "push %%"REG_b" \n\t" ++ "lea (%1,%3), %%"REG_b" \n\t" ++#else + "lea (%1,%3), %%"REG_d" \n\t" ++#endif + + #define REAL_SIMPLE_CPY(src1, src2, dst1, dst2) \ + "movq " #src1 ", %%mm0 \n\t"\ +@@ -3295,18 +3320,32 @@ + #define SIMPLE_CPY(src1, src2, dst1, dst2)\ + REAL_SIMPLE_CPY(src1, src2, dst1, dst2) + ++#if defined(PIC) && !defined(ARCH_X86_64) ++SIMPLE_CPY((%0) , (%0, %2) , (%1) , (%1, %3)) ++SIMPLE_CPY((%0, %2, 2), (%%REGa, %2, 2), (%1, %3, 2), (%%REGb, %3, 2)) ++SIMPLE_CPY((%0, %2, 4), (%%REGa, %2, 4), (%1, %3, 4), (%%REGb, %3, 4)) ++ "lea (%%"REG_a",%2,4), %%"REG_a" \n\t" ++ "lea (%%"REG_b",%3,4), %%"REG_b" \n\t" ++SIMPLE_CPY((%%REGa, %2), (%%REGa, %2, 2), (%%REGb, %3), (%%REGb, %3, 2)) ++ "pop %%"REG_b" \n\t" ++#else + SIMPLE_CPY((%0) , (%0, %2) , (%1) , (%1, %3)) + SIMPLE_CPY((%0, %2, 2), (%%REGa, %2, 2), (%1, %3, 2), (%%REGd, %3, 2)) + SIMPLE_CPY((%0, %2, 4), (%%REGa, %2, 4), (%1, %3, 4), (%%REGd, %3, 4)) + "lea (%%"REG_a",%2,4), %%"REG_a" \n\t" + "lea (%%"REG_d",%3,4), %%"REG_d" \n\t" + SIMPLE_CPY((%%REGa, %2), (%%REGa, %2, 2), (%%REGd, %3), (%%REGd, %3, 2)) ++#endif + + : : "r" (src), + "r" (dst), + "r" ((long)srcStride), + "r" ((long)dstStride) ++#if defined(PIC) && !defined(ARCH_X86_64) ++ : "%"REG_a ++#else + : "%"REG_a, "%"REG_d ++#endif + ); + #else //HAVE_MMX + for(i=0; i<8; i++) --- ffmpeg-0.cvs20070307.orig/debian/patches/005_m68k_workaround.diff +++ ffmpeg-0.cvs20070307/debian/patches/005_m68k_workaround.diff @@ -0,0 +1,13 @@ +Index: ffmpeg.svn/configure +=================================================================== +--- ffmpeg.svn.orig/configure 2007-03-05 20:57:08.000000000 +0100 ++++ ffmpeg.svn/configure 2007-03-05 20:57:28.000000000 +0100 +@@ -1827,6 +1827,8 @@ + if test -n "`$cc -v 2>&1 | grep xlc`"; then + add_cflags "-O5" + add_ldflags "-O5" ++ elif test "$cpu" = "m68k" ; then ++ add_cflags "-O2" + else + add_cflags "-O3" + fi --- ffmpeg-0.cvs20070307.orig/debian/patches/010_proper_rpath.diff +++ ffmpeg-0.cvs20070307/debian/patches/010_proper_rpath.diff @@ -0,0 +1,13 @@ +Index: ffmpeg-0.cvs20070307/configure +=================================================================== +--- ffmpeg-0.cvs20070307.orig/configure 2007-03-09 15:42:57.000000000 +0100 ++++ ffmpeg-0.cvs20070307/configure 2007-03-09 15:44:13.000000000 +0100 +@@ -820,7 +820,7 @@ + VHOOKSHFLAGS='$(SHFLAGS)' + LIBOBJFLAGS="" + FFLDFLAGS=-Wl,--warn-common +-LDLATEFLAGS='-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil' ++LDLATEFLAGS='-L\$(BUILD_ROOT)/libavcodec -L\$(BUILD_ROOT)/libavformat -L\$(BUILD_ROOT)/libavutil -L\$(BUILD_ROOT)/libswscale -Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil -Wl,-rpath-link,\$(BUILD_ROOT)/libswscale' + FFSERVERLDFLAGS=-Wl,-E + LDCONFIG="ldconfig" + LIBPREF="lib" --- ffmpeg-0.cvs20070307.orig/debian/README.Debian +++ ffmpeg-0.cvs20070307/debian/README.Debian @@ -0,0 +1,41 @@ +Notes for the Debian ffmpeg packages +==================================== + + The license for the whole work is the GPL, not the LGPL, because GPL-only +parts of ffmpeg were activated. If you need LGPL versions of the libraries, +please contact me. + + +Summary of the patent issues with ffmpeg +======================================== + + The only patents related to ffmpeg which seem to be enforced against open +source software cover the following codec technologies and file formats: + + * MP3 encoding + * AAC decoding and encoding + * the ASF file format + + I did not activate MP3 encoding (through LAME) in libavcodec, nor AAC +support (through FAAC/FAAD). However, since I have found no real enforcement +of the mysterious ASF file format patents, I did not deactivate ASF support in +libavformat. See more details in the patents.txt file. + + +Differences with unofficial ffmpeg packages +=========================================== + + There are popular unofficial ffmpeg packages at the following URL: + + ftp://ftp.nerim.net/debian-marillat/index.html + + I have nothing to do with these packages and it would be very tedious +for me to track their changes. Given that my official packages use a +Debian-specific naming scheme for libraries, you should be able to +install at least the shared library packages together. + + Before submitting a bug report, please make sure it is related to the +Debian packages and not those unofficial packages. + + + -- Sam Hocevar Thu, 30 Mar 2006 10:23:16 +0200 --- ffmpeg-0.cvs20070307.orig/debian/rules +++ ffmpeg-0.cvs20070307/debian/rules @@ -0,0 +1,155 @@ +#!/usr/bin/make -f + +#export DH_VERBOSE=1 +export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +LIBS = libavutil libavcodec libpostproc libavformat libswscale +confflags += --enable-gpl --enable-pp --enable-swscaler --enable-pthreads +confflags += --enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm + +DEB_VERSION := $(shell dpkg-parsechangelog | sed -ne 's/^Version: //p') + +ifneq (,$(findstring linux,$(DEB_HOST_GNU_TYPE))) + confflags += --enable-dc1394 + lib1394-dev = libraw1394-dev, libdc1394-13-dev + FIREWIRELIBS="-lraw1394 -ldc1394_control" +else + lib1394-dev = + FIREWIRELIBS="" +endif +ifneq (,$(findstring powerpc,$(DEB_BUILD_GNU_TYPE))) + extradoc = doc/ffmpeg_powerpc_performance_evaluation_howto.txt +endif + +ifeq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) + confflags += --disable-debug +endif +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + # This hack is necessary because GCC won't build fdct_mmx.c with -O0 + confflags += --extra-cflags="-O1" +endif +ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + confflags += --disable-strip +endif + +ifneq (,$(findstring risky,$(DEB_BUILD_OPTIONS))) +weak-build-deps += liblame-dev +confflags += --enable-libmp3lame +weak-build-deps += libfaad2-dev +confflags += --enable-libfaadbin --enable-libfaad +weak-build-deps += libfaac-dev +confflags += --enable-libfaac +weak-build-deps += libxvidcore-dev +confflags += --enable-xvid +$(warning Make sure these packages are installed: $(weak-build-deps)) +endif + +build: build-stamp +build-stamp: + dh_testdir + QUILT_PATCHES=debian/patches quilt push -a || test $$? = 2 + + # Build and backup static libraries + ./configure $(confflags) --disable-ffmpeg --disable-vhook --disable-ffserver --disable-ffplay --prefix=/usr + $(MAKE) -C doc + $(MAKE) + for d in $(LIBS); do mv $$d/$$d.a $$d/$$d.a.bak; done + + # Build ffmpeg and shared libraries + ./configure $(confflags) --enable-shared --prefix=/usr + sed 's/ldts/ldts_pic/' config.mak.pic + echo 'CFLAGS += -fPIC -DPIC' >> config.mak.pic + for d in $(LIBS); do \ + $(MAKE) -C $$d clean && \ + rm -f $$d/Makefile.pic && \ + sed 's/config.mak/&.pic/' <$$d/Makefile >$$d/Makefile.pic && \ + $(MAKE) -C $$d -f Makefile.pic && \ + rm -f $$d/Makefile.pic ; \ + done + rm -f config.mak.pic + + # Restore static libraries and fix timestamps + for d in $(LIBS); do \ + mv $$d/$$d.a.bak $$d/$$d.a ; \ + touch $$d/$$d.a ; \ + done + touch ffmpeg ffmpeg_g ffplay ffplay_g + +ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) + -$(MAKE) -C tests +endif + + # Make qt-faststart + $(MAKE) qt-faststart + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + -$(MAKE) -C doc clean + -$(MAKE) -C tests clean + -$(MAKE) distclean + QUILT_PATCHES=debian/patches quilt pop -a -R || test $$? = 2 + for d in $(LIBS); do \ + rm -f $$d/Makefile.pic $$d/$$d.a.bak $$d-unistalled.pc $$d.pc ; \ + done + rm -f config.log + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs -ptmp usr/share/doc/ffmpeg/html etc usr/include/ffmpeg usr/lib usr/bin usr/share/man/man1 usr/include/postproc + + $(MAKE) install DESTDIR=`pwd`/debian/tmp/ mandir=`pwd`/debian/tmp/usr/share/man + cp libavcodec/dsputil.h debian/tmp/usr/include/ffmpeg + cp libpostproc/libpostproc.a debian/tmp/usr/lib + cp libpostproc/postprocess.h debian/tmp/usr/include/postproc + cp libpostproc.pc debian/tmp/usr/lib/pkgconfig/ + for d in $(LIBS); do cp $$d/$$d.so* debian/tmp/usr/lib; done + cp doc/*.html debian/tmp/usr/share/doc/ffmpeg/html/ + cp doc/ffserver.conf debian/tmp/etc/ + + sed -e s/@FIREWIRELIBS@/$(FIREWIRELIBS)/ -e s/@VERSION@/$(DEB_VERSION)/ ffmpeg-config.in > debian/tmp/usr/bin/ffmpeg-config + chmod 644 debian/tmp/usr/bin/ffmpeg-config + cp ffmpeg-config.1 debian/tmp/usr/share/man/man1/ffmpeg-config.1 + cp qt-faststart debian/tmp/usr/bin/qt-faststart + + dh_install --fail-missing --sourcedir=debian/tmp + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs $(extradoc) doc/optimization.txt + dh_installdocs -A MAINTAINERS CREDITS doc/TODO debian/patents.txt debian/README.Debian + dh_installexamples -pffmpeg doc/ffserver.conf + dh_installexamples -plibavcodec-dev libavcodec/apiexample.c + dh_installmenu + dh_installcron + dh_installinfo + dh_installmime + dh_installchangelogs Changelog + dh_link + dh_strip + dh_compress + dh_fixperms + for d in $(LIBS); do \ + dh_makeshlibs -p $${d}1d -V "$${d}1d (>= 0.cvs20070307)" ; \ + done + dh_installdeb + dh_shlibdeps -L libavutil1d -L libavcodec1d -L libpostproc1d -L libavformat1d -L libswscale1d -l debian/libavutil1d/usr/lib:debian/libavcodec1d/usr/lib:debian/libavformat1d/usr/lib:debian/libpostproc1d/usr/lib:debian/libswscale1d/usr/lib + dh_gencontrol -- -Vlib1394-dev="$(lib1394-dev)" + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- ffmpeg-0.cvs20070307.orig/debian/libavformat1d.install +++ ffmpeg-0.cvs20070307/debian/libavformat1d.install @@ -0,0 +1 @@ +usr/lib/libavformat.so.* --- ffmpeg-0.cvs20070307.orig/debian/patents.txt +++ ffmpeg-0.cvs20070307/debian/patents.txt @@ -0,0 +1,88 @@ + +The MP3 audio coding format +=========================== + + Much has already been said about MP3 and the huge patent portfolio of +the MPEG members, especially the Fraunhofer institute. Eric Scheirer's +MPEG, Patents, and Audio Coding FAQ [1.1] is an attempt to "inject +some sanity in what is becoming an increasingly heated discussion +about patent rights surrounding MPEG technology, especially for audio +compression". It also has a few words about other patented products +covered in this document. + +[1.1] http://web.media.mit.edu/~eds/mpeg-patents-faq + + +The AAC audio coding format +=========================== + + Dolby's AAC (Advanced Audio Coding) is covered by patents owned by +Dolby Laboratories, AT&T Laboratories, Fraunhofer Institute and Sony +Corp. + + The FAAC project was threatened by the AAC license consortium. Press +report about how "an opensource project was closed down due to pressures +from the AAC license consortium which requires a lumpsum payment of +10,000 USD plus a per-copy payment of 1.35 USD, thus effectively banning +free software implementations. The policies surrounding AAC also harm +interoperability [2.2]." This was related by Heise [2.3] and FFII has +a page about the Dolby threat [2.1] as well as additional information +about MPEG-related patents [2.4]. + + The author stopped distributing the FAAC binaries, but still provides +full source code and CVS access. To my knowledge he has not been +threatened again. I also read on a web forum [2.5] that Cisco's lawyers +claim that their LGPL distribution of AAC software in MPEG4IP is +completely legal and that Dolby cannot forbid such distribution. + +[2.1] http://swpat.ffii.org/patents/effects/dolby/index.en.html +[2.2] http://www.xiph.org/archives/vorbis-dev/200011/0286.html +[2.3] http://www.heise.de/newsticker/data/vza-20.11.00-000/ +[2.4] http://swpat.ffii.org/patents/effects/mpeg/index.en.html +[2.5] http://www.hydrogenaudio.org/index.php?showtopic=310& + + +The ASF file encapsulation format +================================= + + Microsoft obtained a patent on the ASF (Active Stream Format) audio +file format on March 21, 2000: + + | United States Patent 6,041,345 Levi , et al. March 21, 2000 + | + | Active stream format for holding multiple media streams + | + | Abstract An active stream format is defined and adopted for a + | logical structure that encapsulates multiple data streams. The data + | streams may be of different media. The data of the data streams + | is partitioned into packets that are suitable for transmission + | over a transport medium. The packets may include error correcting + | information. The packets may also include clock licenses for + | dictating the advancement of a clock when the data streams are + | rendered. The format of ASF facilitates flexibility and choice + | of packet size and in specifying maximum bit rate at which data + | may be rendered. Error concealment strategies may be employed in + | the packetization of data to distribute portions of samples to + | multiple packets. Property information may be replicated and stored + | in separate packets to enhance its error tolerance. The format + | facilitates dynamic definition of media types and the packetization + | of data in such dynamically defined data types within the format. + + This patent is rumoured to have been enforced at least once, though +only through what I'd call non-hostile intimidation. Avery Lee, the +VirtualDub author, removed ASF support from his software after a phone +call from a Microsoft employee that he relates in his 5/12/2000 news +[3.1]. + + However I could not find evidence of an official threat: all I could +find on the web seemed to be interpretations of the VirtualDub author's +article, for instance on Advogato [3.2], CPT [3.3] or FFII [3.4]. Avery +Lee states that the phone call was from a programmer, not from the +legal department. There does not seem to be an official statement from +Microsoft. + +[3.1] http://web.archive.org/web/20000817222620/http://www.geocities.com/virtualdub/virtualdub_news.html +[3.2] http://www.advogato.com/article/101.html +[3.3] http://www.cptech.org/ip/business/software/audio.html +[3.4] http://swpat.ffii.org/patents/effects/asf/index.en.html + --- ffmpeg-0.cvs20070307.orig/debian/libavutil-dev.install +++ ffmpeg-0.cvs20070307/debian/libavutil-dev.install @@ -0,0 +1,18 @@ +usr/bin/ffmpeg-config +usr/share/man/man1/ffmpeg-config.1 +usr/lib/pkgconfig/libavutil.pc +usr/include/ffmpeg/avutil.h +usr/include/ffmpeg/adler32.h +usr/include/ffmpeg/common.h +usr/include/ffmpeg/fifo.h +usr/include/ffmpeg/integer.h +usr/include/ffmpeg/intfloat_readwrite.h +usr/include/ffmpeg/log.h +usr/include/ffmpeg/lzo.h +usr/include/ffmpeg/mathematics.h +usr/include/ffmpeg/md5.h +usr/include/ffmpeg/opt.h +usr/include/ffmpeg/random.h +usr/include/ffmpeg/rational.h +usr/lib/libavutil.a +usr/lib/libavutil.so --- ffmpeg-0.cvs20070307.orig/debian/libavcodec-dev.install +++ ffmpeg-0.cvs20070307/debian/libavcodec-dev.install @@ -0,0 +1,5 @@ +usr/lib/pkgconfig/libavcodec.pc +usr/include/ffmpeg/avcodec.h +usr/include/ffmpeg/dsputil.h +usr/lib/libavcodec.a +usr/lib/libavcodec.so --- ffmpeg-0.cvs20070307.orig/debian/ffmpeg.install +++ ffmpeg-0.cvs20070307/debian/ffmpeg.install @@ -0,0 +1,10 @@ +etc/ffserver.conf +usr/lib/vhook +usr/bin/ffmpeg +usr/bin/ffserver +usr/bin/ffplay +usr/bin/qt-faststart +usr/share/doc/ffmpeg +usr/share/man/man1/ffmpeg.1 +usr/share/man/man1/ffserver.1 +usr/share/man/man1/ffplay.1 --- ffmpeg-0.cvs20070307.orig/debian/libswscale1d.install +++ ffmpeg-0.cvs20070307/debian/libswscale1d.install @@ -0,0 +1 @@ +usr/lib/libswscale.so.* --- ffmpeg-0.cvs20070307.orig/debian/libswscale-dev.install +++ ffmpeg-0.cvs20070307/debian/libswscale-dev.install @@ -0,0 +1,5 @@ +usr/lib/pkgconfig/libswscale.pc +usr/include/ffmpeg/swscale.h +usr/include/ffmpeg/rgb2rgb.h +usr/lib/libswscale.a +usr/lib/libswscale.so --- ffmpeg-0.cvs20070307.orig/debian/changelog +++ ffmpeg-0.cvs20070307/debian/changelog @@ -0,0 +1,647 @@ +ffmpeg (3:0.cvs20070307-5ubuntu7.4) hardy-security; urgency=low + + * SECURITY UPDATE: Fix a multitude of security issues + - debian/patches/CVE-2009-46XX/security-issue03.patch: check stream + existence before assignment + - debian/patches/CVE-2009-46XX/security-issue04.patch: check submap + indexes + - debian/patches/CVE-2009-46XX/security-issue05.patch: check classbook + value + - debian/patches/CVE-2009-46XX/security-issue06.patch: add checks for + per-packet mode indexes and per-header mode mapping indexes + - debian/patches/CVE-2009-46XX/security-issue07.patch: check masterbook + index and subclass book index. + - debian/patches/CVE-2009-46XX/security-issue08.patch: check + res_setup->books + - debian/patches/CVE-2009-46XX/security-issue09.patch: check + begin/end/partition_size + - debian/patches/CVE-2009-46XX/security-issue10.patch: check validity + of channels & samplerate + - debian/patches/CVE-2009-46XX/security-issue11.patch: fix book_idx + check + - debian/patches/CVE-2009-46XX/security-issue12.patch: sanity checks + for magnitude and angle + - debian/patches/CVE-2009-46XX/security-issue13.patch: fix = -> == typo + - debian/patches/CVE-2009-46XX/security-issue14.patch: check dimensions + against 0 too + - debian/patches/CVE-2009-46XX/security-issue17.patch: make sure that + all memory allocations succeed + - debian/patches/CVE-2009-46XX/security-issue19.patch: set data_size to + 0 to avoid having it uninitialized + - debian/patches/CVE-2009-46XX/security-issue22.patch: check codec_id + and codec_type, make sure priv_data is freed and codec is set to NULL + - CVE-2009-4633 + - CVE-2009-4634 + - CVE-2009-4635 + - CVE-2009-4637 + - CVE-2009-4639 + - CVE-2009-4640 + + -- Marc Deslauriers Thu, 08 Apr 2010 09:37:22 -0400 + +ffmpeg (3:0.cvs20070307-5ubuntu7.3) hardy-security; urgency=low + + * SECURITY UPDATE: denial of service via a malformed Ogg Media (OGM) file + - debian/patches/100_security_CVE-2008-4610.diff: properly check return + codes in libavcodec/vp3.c. + - CVE-2008-4610 + * SECURITY UPDATE: buffer overflow caused by an incorrect DCA_MAX_FRAME_SIZE + value + - debian/patches/101_security_CVE-2008-4867.diff: set DCA_MAX_FRAME_SIZE to + a correct value in libavcodec/dca.c. + - CVE-2008-4867 + * SECURITY UPDATE: arbitrary code execution via a malformed 4X movie file + (LP: #323620) + - debian/patches/102_security_CVE-2009-0385.diff: validate current_track + value in libavformat/4xm.c. + - CVE-2009-0385 + + -- Marc Deslauriers Mon, 16 Mar 2009 16:32:40 -0400 + +ffmpeg (3:0.cvs20070307-5ubuntu7.1) hardy-security; urgency=low + + * SECURITY UPDATE: crash from crafted STR file. + * Add debian/patches/400_str_file_crash.diff: backported upstream fixes. + * References + CVE-2008-3162 + + -- Kees Cook Wed, 23 Jul 2008 13:28:45 -0700 + +ffmpeg (3:0.cvs20070307-5ubuntu7) hardy; urgency=low + + * added qt-faststart (LP: #200996) + reorders the components of an H.264 MPEG4 video file to enable progressive + download playback of certain H.264 videos in the Flash Player browser plugin. + * debian/rules: + - build: $(MAKE) qt-faststart + - install: cp this to debian/tmp/usr/bin/ + * debian/ffmpeg.install: + - added usr/bin/qt-faststart + + -- Stephan Hermann Tue, 11 Mar 2008 11:52:21 +0100 + +ffmpeg (3:0.cvs20070307-5ubuntu6) hardy; urgency=low + + * Implemented 061_fix_resample_warnings.diff + Fixes LP: #122266 + * debian/control: + - set MOTU as maintainer + - set XSBC-Original-Maintainer: Debian multimedia packages maintainers + + -- Mario Danic Mon, 06 Aug 2007 16:19:27 +0200 + +ffmpeg (3:0.cvs20070307-5ubuntu5) hardy; urgency=low + + * Rebuilt against new libx264 + + -- Anthony Mercatante Sun, 02 Dec 2007 21:20:07 +0100 + +ffmpeg (3:0.cvs20070307-5ubuntu4) gutsy; urgency=low + + * make ffmpeg-config not add -ldts and -la52 to LDFLAGS. fixes FTBFS in + unrelated packages. + + -- Reinhard Tartler Sun, 03 Jun 2007 18:21:33 +0200 + +ffmpeg (3:0.cvs20070307-5ubuntu3) gutsy; urgency=low + + * remove dependency on libdts-dev and liba52-dev from libavcodec-dev + * remove incorrect VCS information + + -- Reinhard Tartler Sat, 02 Jun 2007 15:09:03 +0200 + +ffmpeg (3:0.cvs20070307-5ubuntu2) gutsy; urgency=low + + * Fix FTBFS. was too agressive with removing libdts support, breaking + the shared library build on amd64. + + -- Reinhard Tartler Wed, 30 May 2007 22:06:55 +0200 + +ffmpeg (3:0.cvs20070307-5ubuntu1) gutsy; urgency=low + + * merge debian changes + * remove liba52 support for now (not in main ATM) + * remove libdts support for now (not in main ATM) + + -- Reinhard Tartler Wed, 30 May 2007 15:59:41 +0200 + +ffmpeg (0.cvs20070307-5) unstable; urgency=low + + * upload to unstable + * remove x264 support, as it has been removed from unstable + + -- Reinhard Tartler Wed, 30 May 2007 15:19:20 +0200 + +ffmpeg (3:0.cvs20070307-4ubuntu1) gutsy; urgency=low + + * fakesync for debian + * added back epoch + * tighten build dependency on x264, the version from feisty causes ftbfs + + -- Reinhard Tartler Sun, 29 Apr 2007 21:27:46 +0200 + +ffmpeg (0.cvs20070307-4) experimental; urgency=low + + * added myself to uploaders + + * 020_fix_libswscale_pic_code: + + added, avoid some MMX code to avoid PIC code + + [ Sam Hocevar ] + + * fixed path in library installation. + + -- Reinhard Tartler Wed, 11 Apr 2007 23:17:47 +0200 + +ffmpeg (0.cvs20070307-3) experimental; urgency=low + + * debian/patches/015_build_imgresample.diff: + + Build imgresample functions even with swscaler activated, or legacy + applications will stop working. + + * debian/patches/053_rm_demux_crash.diff: + + New patch: fix a double free with corrupted rm files (Closes: #379922). + + * debian/patches/054_h264_mmx_chroma_mc_crash.diff: + + New patch: workaround for a buffer overflow in the MMX H264 chroma + motion compensation until upstream fixes it properly (Closes: #404176). + + * debian/patches/300_c++_compliant_headers.diff: + + Define INT64_C() when the system headers don't provide it, for instance + when building C++ code. + + * debian/control: + + Set pkg-multimedia-maintainers as main maintainer. + + Updated VCS fields. + * debian/rules: + + Huge cleanup. + + -- Sam Hocevar (Debian packages) Wed, 14 Mar 2007 19:40:42 +0100 + +ffmpeg (0.cvs20070307-2) experimental; urgency=low + + * debian/rules: + + Activate x264 support now that it is in unstable. + * debian/control: + + Build-depend on libx264-dev. + + -- Sam Hocevar (Debian packages) Mon, 12 Mar 2007 21:10:45 +0100 + +ffmpeg (0.cvs20070307-1) experimental; urgency=low + + [ Sam Hocevar ] + + * New upstream snapshot (Closes: #403330, #404788). + * This snapshot fixes numerous file parsing crashes (Closes: #404176, + Closes: #407003, #396282, #365006, #403398). + + * debian/patches/010_proper_rpath.diff: + + New patch. Link objects with the libraries that we generate, not the + ones installed on the system. + + * debian/patches/010_shared_library_versioning.diff: + + Strip unneeded prefix from .pc files (Closes: #404758). + + * debian/patches/011_link_plugins.diff: + + New patch. Link vhook plugins with the appropriate libraries. + + * debian/patches/013_strip_unneeded_linker_flags.diff: + + Remove unneeded -l flags from .pc files (Closes: #373986). + + * debian/patches/020_mmx_optims.diff: + * debian/patches/020_disable_snow_mmx_in_pic.diff: + + Sync patches. + + * debian/patches/020_really_use_liba52.diff: + * debian/patches/050_h264-misc-security-fixes.diff: + * debian/patches/051_asf-misc-security-fixes.diff: + + Drop patches, applied upstream or no longer relevant. + + * debian/patches/040_only_use_maltivec_when_needed.diff: + + Upgraded patch to cover libswscale. + + * debian/libavcodec-dev.install: + + Ship lzo.h and random.h. + + * debian/rules: + + Fix syntax for a few --enable flags. + + Only ship ffmpeg_powerpc_performance_evaluation_howto.txt.gz on + powerpc machines (Closes: #385079). + + Readded --enable-libtheora, it's here again. + + Activate --enable-swscaler (Closes: #399141, #398442). + + [ Reinhard Tartler ] + + * debian/rules: + + Ignore libswscale.pc and rgb2rgb.h. + + * debian/libavcodec-dev.install: + + Ship fifo.h and opt.h. + + * debian/patches/005_altivec_flags.diff: + * debian/patches/005_m68k_workaround.diff: + * debian/patches/005_runtime_cpudetect.diff: + * debian/patches/006_mips_pthreads.diff: + * debian/patches/020_really_use_liba52.diff: + + Sync patches. + + * debian/patches/007_disable_ffmpeg_option.diff: + * debian/patches/030_arm_cpu_detect.diff: + * debian/patches/030_arm_workaround.diff: + + Drop patches, applied upstream or no longer relevant. + + -- Sam Hocevar (Debian packages) Fri, 9 Mar 2007 15:13:16 +0100 + +ffmpeg (0.cvs20060823-7) unstable; urgency=high + + * debian/patches/040_only_use_maltivec_when_needed.diff: + + Fix a static function prototype that prevented programs using libpostproc + from working on PowerPC (Closes: #412214). + + * debian/control: + + Added Xs-Vcs-Browser and XS-Vcs-Svn fields. + + -- Sam Hocevar (Debian packages) Thu, 8 Mar 2007 17:51:37 +0100 + +ffmpeg (0.cvs20060823-6) unstable; urgency=high + + * Upload to unstable. + + -- Loic Minier Thu, 1 Feb 2007 21:36:47 +0100 + +ffmpeg (0.cvs20060823-5) testing-proposed-updates; urgency=high + + [ Loïc Minier ] + * Add myself to Uploaders. + * Exclude firewire libs from ffmpeg-config under kFreeBSD; based on a patch + by Petr Salinger; closes: #399701. + * Fix handling of debug in DEB_BUILD_OPTIONS; thanks Andreas Henriksson; + closes: #406474. + * SECURITY: New patch, 050_h264-misc-security-fixes, to properly check the + sps and pps ids before use and to check more bitstram values and fix + potential security holes; from upstream SVN r7585, r7586, and r7591. + * SECURITY: New patch, 051_asf-misc-security-fixes, to properly check + packet sizes, chunk sizes, and fragment positions; from upstream SVN r7640 + and r7650. + + [ Sam Hocevar ] + * debian/copyright: + + Fix typo and clarify licensing terms (Closes: #398235). + * debian/README.Debian: + + Removed mention of ffmpeg-config now that we ship .pc files. + * debian/patches/020_mmx_optims.diff: + + New patch, fix FTBFS with DEB_BUILD_OPTIONS=debug. + * debian/patches/040_early_altivec_detection.diff: + + New patch, detect AltiVec earlier on and only once so that we don't + risk using signal handlers in a multithreaded environment or when + the caller already installed a SIGILL handler. + * debian/patches/040_only_use_maltivec_when_needed.diff: + + New patch, only use -maltivec with files that use AltiVec intrinsics, + and make sure no codepath leads to these files on a non-AltiVec + machine (Closes: #405926). + * debian/patches/060_fix_avi_skip.diff: + + New patch, courtesy of Ben Hutchings: do not attempt to skip the ODML + if the current seek offset is already beyond it (Closes: #383734). + + -- Sam Hocevar (Debian packages) Mon, 29 Jan 2007 16:58:44 +0100 + +ffmpeg (0.cvs20060823-4) unstable; urgency=high + + * Maintainer upload. + * Acknowledging NMU (Closes: #386458). + + * High urgency because of FTBFS fix. + + * debian/patches/030_arm_workaround.diff: + + New patch courtesy of Aurélien Jarno: disable the broken ARM assembly + code in libavcodec/mpegaudiodec.c. + + * debian/patches/030_arm_cpu_detect.diff: + + New patch courtesy of Aurélien Jarno: correctly detect the newer ARM + CPUs. + + -- Sam Hocevar (Debian packages) Sun, 24 Sep 2006 23:38:29 +0200 + +ffmpeg (0.cvs20060823-3.1) unstable; urgency=medium + + * Non-maintainer upload. + * Fix variable substitution trick in debian/rules (Closes: #386458). + + -- Luk Claes Fri, 15 Sep 2006 21:29:07 +0200 + +ffmpeg (0.cvs20060823-3) unstable; urgency=low + + * debian/rules: + + Take local packages into account when computing shlibs dependencies, so + that ffplay/ffserver depend on the proper libraries (Closes: #386029). + + -- Sam Hocevar (Debian packages) Tue, 5 Sep 2006 17:44:00 +0200 + +ffmpeg (0.cvs20060823-2) unstable; urgency=low + + * debian/patches/020_really_use_liba52.diff: + + New patch: link with the shared liba52 instead of the built-in one. + + * debian/patches/006_mips_pthreads.diff: + + New patch: link libraries with -lpthreads on Linux MIPS because of a + known ld bug. + + * debian/patches/007_disable_ffmpeg_option.diff: + + New patch: add a --disable-ffmpeg option. + + -- Sam Hocevar (Debian packages) Wed, 30 Aug 2006 18:36:52 +0200 + +ffmpeg (0.cvs20060823-1) unstable; urgency=low + + * New SVN snapshot (Closes: #368904). + * debian/control: + + Set policy to 3.7.2. + + Do not build 1394 support on GNU/kFreeBSD or Hurd. Patch courtesy of + Petr Salinger (Closes: #372290). + * debian/rules: + + Minor cleanup. + + Removed --enable-theora, upstream dropped that option. + + * debian/patches/020_mmx_intrinsics.diff: + + Disabled intrinsics workaround because it is no longer necessary and it + causes trouble with some codecs such as H264 (Closes: #373765). + + -- Sam Hocevar (Debian packages) Wed, 23 Aug 2006 12:09:58 +0200 + +ffmpeg (0.cvs20060329-4) unstable; urgency=low + + * debian/control: + + Make each -dev package depend on the corresponding shared library + package (Closes: #361348). + + Moved libavutil files from libavformat-dev to libavcodec-dev which is + the real common dependency (Closes: #361269). + + -- Sam Hocevar (Debian packages) Sun, 9 Apr 2006 15:23:37 +0200 + +ffmpeg (0.cvs20060329-3) unstable; urgency=low + + * debian/rules: that build system is hopeless. We now run configure and + make twice, backup static libraries inbetween, then update timestamps + to fool make. That should fix the FTBFS (Closes: #361215). + + -- Sam Hocevar (Debian packages) Fri, 7 Apr 2006 11:33:15 +0200 + +ffmpeg (0.cvs20060329-2) unstable; urgency=low + + * debian/rules: fixed Makefile.pic generation. + + -- Sam Hocevar (Debian packages) Thu, 6 Apr 2006 16:37:05 +0200 + +ffmpeg (0.cvs20060329-1) unstable; urgency=low + + * New CVS snapshot. + * Upstream fixed a double free in img.c (Closes: #351455). + * Upstream fixed the libvorbisenc dependency in libavcodec.pc + (Closes: #357352). + + * debian/rules: + + Activated threading support (Closes: #335677). + + Manually reinstall dsputil.h. + + * debian/README.Debian: + + Removed mention of --plugin-libs. + + Added a note about the unofficial packages (Closes: #306752). + + * 020_disable_snow_mmx_in_pic.diff: (new patch) disable MMX acceleration in + the Snow encoder in PIC mode. + + -- Sam Hocevar (Debian packages) Thu, 30 Mar 2006 10:41:17 +0200 + +ffmpeg (0.cvs20060306-3) unstable; urgency=low + + * Switched patch system to quilt. + * debian/control: + + Build-depend on quilt. + + * 005_altivec_flags.diff: (new patch from old diff.gz) proper gcc flags to + only generate AltiVec code when explicitely asked. + + * 005_m68k_workaround.diff: (new patch from old diff.gz) use -O2 instead of + -O3 on m68k. + + * 005_runtime_cpudetect.diff: (new patch from old diff.gz) fix runtime CPU + detection on m68k and x86. + + * 010_ffmpeg-config.diff: (new patch from old diff.gz) the ffmpeg-config + script and associated manpage (legacy). + + * 010_shared_library_versioning.diff: (new patch from old diff.gz) use a + Debian-specific scheme for shared library versioning to avoid spreading + libraries incompatible with every other version. + + * 020_mmx_intrinsics.diff: (new patch from old diff.gz) use MMX intrinsics + in dsputil_mmx.c because gcc is unable to compute some register constraints + in PIC mode. + + * 020_mmx_pic_code.diff: (new patch from old diff.gz) ported some MMX code + to be PIC. + + -- Sam Hocevar (Debian packages) Wed, 29 Mar 2006 18:53:35 +0200 + +ffmpeg (0.cvs20060306-2) unstable; urgency=low + + * ffmpeg-config.in: removed references to _pic libraries. + + -- Sam Hocevar (Debian packages) Fri, 17 Mar 2006 20:08:29 +0100 + +ffmpeg (0.cvs20060306-1) unstable; urgency=low + + * New CVS snapshot. + * Upstream now properly installs dsputil.h (Closes: #354391). + * debian/control: + + Distribute shared versions of the libraries with a Debian-specific + soname. + * debian/rules: + + Removed all custom PIC rules. + + Moved ffmpeg-config to libavformat-dev instead of libavcodec-dev so that + it is present by default (Closes: #350750). + + Include apiexample.c in libavcodec-dev (Closes: #350027). + + -- Sam Hocevar (Debian packages) Mon, 6 Mar 2006 11:05:26 +0100 + +ffmpeg (0.cvs20050918-6) unstable; urgency=low + + * Developer upload. + * Acknowledge NMU. Thanks to Samuel Mimram (Closes: #342207). + * configure: + + Set RUNTIME_CPUDETECT (except on m68k where it ICEs and on x86 where it + fails to build some asm constructs) (Closes: #337846). + * debian/rules: + + Make the build process aware of DEB_BUILD_OPTIONS, thanks to Timo + Lindfors (Closes: #338895). + + -- Sam Hocevar (Debian packages) Sat, 21 Jan 2006 16:51:26 +0100 + +ffmpeg (0.cvs20050918-5.1) unstable; urgency=low + + * NMU. + * Fix exploitable heap overflow in libavcodec's handling of images with + PIX_FMT_PAL8 pixel formats (CVE-2005-4048), closes: #342207. + + -- Samuel Mimram Sun, 15 Jan 2006 14:44:36 +0100 + +ffmpeg (0.cvs20050918-5) unstable; urgency=low + + * ffmpeg-config.1: fixed the examples and added a note that static libraries + should be put after the objects that refer to them (Closes: #339803). + + -- Sam Hocevar (Debian packages) Fri, 18 Nov 2005 23:58:16 +0100 + +ffmpeg (0.cvs20050918-4) unstable; urgency=low + + * configure: + + Tell the configure script about m68k, ia64 and others. + + -- Sam Hocevar (Debian packages) Thu, 22 Sep 2005 14:43:59 +0200 + +ffmpeg (0.cvs20050918-3) unstable; urgency=low + + * configure: + + Use -O2 instead of -O3 on m68k to avoid ICEs. + + -- Sam Hocevar (Debian packages) Tue, 20 Sep 2005 17:33:14 +0200 + +ffmpeg (0.cvs20050918-2) unstable; urgency=low + + * libavcodec/i386/dsputil_mmx.c: + + Reworked the MMX intrinsics. + * tests/libav.regression.ref: + + Minor cosmetic fix to use double-digit numbers in test sequences. + * debian/control: + + PowerPC no longer needs to use gcc-3.4, since 4.x is the default. + * libavcodec/Makefile: + + Removed special compilation case for HPPA now that we use 4.x. + + -- Sam Hocevar (Debian packages) Sun, 18 Sep 2005 17:43:48 +0200 + +ffmpeg (0.cvs20050918-1) unstable; urgency=low + + * New CVS snapshot. + * Upstream applied most Debian patches. + * configure: + + Do not use -mabi=altivec (-maltivec is enough for our AltiVec code) so + that our code still runs on a G3 computer (Closes: #319151). + * debian/rules: + + When not cross-compiling, run the regression tests (Closes: #292102). + * debian/changelog: + + Updated the FSF address. + * ffmpeg-config.in: + + Fixed avcodec linkage (Closes: #328505). + * libavcodec/i386/mpegvideo_mmx_template.c: + + Applied patch from Tobias Grimm to fix the PIC MMX code for MPEG + encoding (Closes: #318493). + * libavcodec/i386/dsputil_mmx.c: + + Applied patch from Joshua Kwan to fix the AMD64 build (Closes: #324026). + + Reworked that patch so that it still compiles on x86. + + -- Sam Hocevar (Debian packages) Fri, 16 Sep 2005 13:03:47 +0200 + +ffmpeg (0.cvs20050811-2) unstable; urgency=low + + * ffmpeg-config.in: added a missing -lgsm. + + -- Sam Hocevar (Debian packages) Mon, 22 Aug 2005 19:51:53 +0200 + +ffmpeg (0.cvs20050811-1) unstable; urgency=low + + * New CVS snapshot. + * Upstream fixed an integer overflow in the MPEG encoder (Closes: #320150). + * debian/rules: + + Activated libgsm support. + + Fixed theora support. + + Switched installation method to dh_install. + * Applied patch from Christian Aichinger and others to fix the clobbering + of the %ebx register during build (Closes: #319563). + + -- Sam Hocevar (Debian packages) Thu, 11 Aug 2005 14:22:03 +0200 + +ffmpeg (0.cvs20050626-2) unstable; urgency=low + + * ffmpeg-config.in: fixed the theora link that caused FTBFS. + + -- Sam Hocevar (Debian packages) Fri, 1 Jul 2005 17:20:59 +0200 + +ffmpeg (0.cvs20050626-1) unstable; urgency=low + + * New CVS snapshot. + * debian/control: + + Set policy to 3.6.2.1. + * debian/rules: + + Fixed Vorbis support (Closes: #306023). + + Patch by Jonas Smedegaard : conditionally enable these + unofficial libraries if DEB_BUILD_OPTIONS includes "risky": + o Mpeg2 layer 3 / MP3 (liblame-dev). + o FAAD (libfaad2-dev). + o FAAC (libfaac-dev). + o XviD (libxvidcore-dev). + + Activated theora support. + + Activated IEEE 1394 support (Closes: #296737). + + -- Sam Hocevar (Debian packages) Sun, 26 Jun 2005 15:46:54 +0200 + +ffmpeg (0.cvs20050313-2) unstable; urgency=low + + * libavcodec/libpostproc/postprocess_template.c + libavcodec/i386/mpegvideo_mmx_template.c: fixed my PIC MMX code (Closes: #299700). + * debian/rules: use gcc-3.4 on PowerPC (Closes: #300686). + + -- Sam Hocevar (Debian packages) Mon, 21 Mar 2005 23:38:46 +0100 + +ffmpeg (0.cvs20050313-1) unstable; urgency=low + + * New CVS snapshot. + * configure: fixed the builtin vector test (Closes: #293284), thanks + to Jacob L. Anawalt. + * libavcodec/libpostproc/postprocess_template.c + libavcodec/i386/mpegvideo_mmx_template.c: fixed MMX code so that it can + be compiled in PIC mode, and reactivated MMX (Closes: #290447, #290358). + + -- Sam Hocevar (Debian packages) Sat, 12 Mar 2005 18:34:29 +0100 + +ffmpeg (0.cvs20050121-1) unstable; urgency=low + + * New CVS snapshot. + * This snapshot fixes integer overflows that may lead to arbitrary code + execution (Closes: #291566). + + -- Sam Hocevar (Debian packages) Fri, 21 Jan 2005 17:41:47 +0100 + +ffmpeg (0.cvs20050108-1) unstable; urgency=low + + * Re-done tarball snapshot so that it does not contain binaries. + * ffmpeg-config.in: + + Added missing -lvorbisenc (Closes: #289030). + * debian/rules: + + Install missing headers that are not in the install rule: bwswap.h, + dsputil.h, os_support.h (Closes: #289033). + + -- Sam Hocevar (Debian packages) Sat, 8 Jan 2005 11:30:58 +0100 + +ffmpeg (0.cvs20050106-1) unstable; urgency=low + + * New upstream snapshot. + * The extern/static declaration conflict was fixed upstream (Closes: #288906). + + -- Sam Hocevar (Debian packages) Thu, 6 Jan 2005 15:44:49 +0100 + +ffmpeg (0.cvs20040716-2) unstable; urgency=low + + * debian/rules: + + Include missing rtp.h / rtsp.h in libavformat-dev. + * ffmpeg-config.in: + + Added -lz to the libavcodec linking flags. + + Added -ldts / -ldts_pic, -la52, -lvorbis to the libavcodec linking flags. + + -- Sam Hocevar (Debian packages) Tue, 17 Aug 2004 13:27:41 +0200 + +ffmpeg (0.cvs20040716-1) unstable; urgency=low + + * Initial release (Closes: #199266). + + -- Sam Hocevar (Debian packages) Fri, 16 Jul 2004 12:47:27 +0200 + --- ffmpeg-0.cvs20070307.orig/debian/compat +++ ffmpeg-0.cvs20070307/debian/compat @@ -0,0 +1 @@ +4 --- ffmpeg-0.cvs20070307.orig/debian/copyright +++ ffmpeg-0.cvs20070307/debian/copyright @@ -0,0 +1,95 @@ +This package was downloaded from the ffmpeg CVS by Sam Hocevar . + +Upstream Authors: Fabrice Bellard + Alex Beregszaszi + BERO + Mario Brito + Ronald Bultje + Tim Ferguson + Brian Foley + Arpad Gereoffy + Philip Gladstone + Vladimir Gneushev + Wolfgang Hesseler + Falk Hueffner + Zdenek Kabelac + Robin Kay + Todd Kirby + Nick Kurshev + Mike Melanson + Michael Niedermayer + François Revol + Roman Shaposhnik + Dieter Shirley + Juan J. Sierralta + Ewald Snel + Leon van Stuivenberg + Roberto Togni + Lionel Ulmer + +Copyright (c) 2000-2004 Fabrice Bellard et al. + +The following files are licensed under the GNU GPL, as clarified below: + + * ffmpeg.c + * libavcodec: + + dtsdec.c + + i386/idct_mmx.c + + liba52/*.[ch] + * libavformat: + + x11grab.c + + gxfenc.c + * libpostproc: + + postprocess_internal.h + + postprocess_altivec_template.c + + postprocess.h + + postprocess_template.c + + postprocess.c + + mangle.h + * libswscale: + + swscale.c + + swscale-example.c + + yuv2rgb_template.c + + swscale_altivec_template.c + + yuv2rgb_altivec.c + + swscale_template.c + + rgb2rgb_template.c + + rgb2rgb.c + + cs_test.c + + yuv2rgb_mlib.c + + yuv2rgb.c + + | This library is free software; you can redistribute it and/or + | modify it under the terms of the GNU General Public License as + | published by the Free Software Foundation; either version 2 of + | the License, or (at your option) any later version. + | + | This library is distributed in the hope that it will be useful, + | but WITHOUT ANY WARRANTY; without even the implied warranty of + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + | Lesser General Public License for more details. + | + | You should have received a copy of the GNU General Public License + | along with this program; if not, write to the Free Software + | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +The rest of the code is licensed under the GNU LGPL: + + | This library is free software; you can redistribute it and/or + | modify it under the terms of the GNU Lesser General Public License as + | published by the Free Software Foundation; either version 2.1 of + | the License, or (at your option) any later version. + | + | This library is distributed in the hope that it will be useful, + | but WITHOUT ANY WARRANTY; without even the implied warranty of + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + | Lesser General Public License for more details. + | + | You should have received a copy of the GNU General Public License + | along with this program; if not, write to the Free Software + | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian GNU/Linux systems, the complete text of the GNU General Public +License can be found in `/usr/share/common-licenses/GPL' and the text of the +GNU Lesser General Public License is in `/usr/share/common-licenses/LGPL'. + --- ffmpeg-0.cvs20070307.orig/debian/control +++ ffmpeg-0.cvs20070307/debian/control @@ -0,0 +1,131 @@ +Source: ffmpeg +Section: libs +Priority: optional +Maintainer: Ubuntu MOTU Developers +XSBC-Original-Maintainer: Debian multimedia packages maintainers +Uploaders: Sam Hocevar (Debian packages) , Loic Minier , Reinhard Tartler +Build-Depends: debhelper (>= 4.0), quilt, libogg-dev, libvorbis-dev, zlib1g-dev, libsdl1.2-dev, libfreetype6-dev, libimlib2-dev, texi2html, libraw1394-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], libdc1394-13-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], libtheora-dev (>> 0.0.0.alpha4), libgsm1-dev +Standards-Version: 3.7.2 + +Package: ffmpeg +Section: graphics +Architecture: any +Depends: ${shlibs:Depends} +Description: multimedia player, server and encoder + This package contains the ffplay multimedia player, the ffserver streaming + server and the ffmpeg audio and video encoder. They support most existing + file formats (AVI, MPEG, OGG, Matroska, ASF...) and encoding formats (MPEG, + DivX, MPEG4, AC3, DV...). + +Package: libavutil1d +Section: libs +Architecture: any +Depends: ${shlibs:Depends} +Description: ffmpeg utility library + This is the common utility library from the ffmpeg project. It is required + by all other ffmpeg libraries. + . + This package contains a Debian-specific version of the libswscale shared + object that should only be used by Debian packages. + +Package: libavcodec1d +Section: libs +Architecture: any +Depends: ${shlibs:Depends} +Description: ffmpeg codec library + This is the codec library from the ffmpeg project. It supports most existing + encoding formats (MPEG, DivX, MPEG4, AC3, DV...). + . + This package contains a Debian-specific version of the libavcodec shared + object that should only be used by Debian packages. + +Package: libpostproc1d +Section: libs +Architecture: any +Depends: ${shlibs:Depends} +Description: ffmpeg video postprocessing library + This is the video postprocessing library from the ffmpeg project. + . + This package contains a Debian-specific version of the libpostproc shared + object that should only be used by Debian packages. + +Package: libavformat1d +Section: libs +Architecture: any +Depends: ${shlibs:Depends} +Description: ffmpeg file format library + This is the demuxer library from the ffmpeg project. It supports most + existing file formats (AVI, MPEG, OGG, Matroska, ASF...). + . + This package contains a Debian-specific version of the libavformat shared + object that should only be used by Debian packages. + +Package: libswscale1d +Section: libs +Architecture: any +Depends: ${shlibs:Depends} +Description: ffmpeg video scaling library + This is the video scaling library from the ffmpeg project. + . + This package contains a Debian-specific version of the libswscale shared + object that should only be used by Debian packages. + +Package: libavutil-dev +Section: libdevel +Architecture: any +Depends: libavutil1d (= ${Source-Version}), ${shlibs:Depends} +Conflicts: libavformat-dev (<< 0.cvs20060329-4), libavcodec-dev (<< 0.cvs20070307-1) +Replaces: libavformat-dev (<< 0.cvs20060329-4), libavcodec-dev (<< 0.cvs20070307-1) +Description: development files for libavutil + This is the common utility library from the ffmpeg project. It is required + by all other ffmpeg libraries. + . + This package contains the header files and static libraries needed to + compile applications or shared objects that use libavutil. + +Package: libavcodec-dev +Section: libdevel +Architecture: any +Depends: libavcodec1d (= ${Source-Version}), libavutil-dev (= ${Source-Version}), libvorbis-dev, libogg-dev, zlib1g-dev, ${lib1394-dev}, libtheora-dev (>> 0.0.0.alpha4), libgsm1-dev, ${shlibs:Depends} +Conflicts: libavformat-dev (<< 0.cvs20060329-4) +Replaces: libavformat-dev (<< 0.cvs20060329-4) +Description: development files for libavcodec + This is the codec library from the ffmpeg project. It supports most existing + encoding formats (MPEG, DivX, MPEG4, AC3, DV...). + . + This package contains the header files and static libraries needed to + compile applications or shared objects that use libavcodec. + +Package: libpostproc-dev +Section: libdevel +Architecture: any +Depends: libpostproc1d (= ${Source-Version}), libavcodec-dev (= ${Source-Version}), ${shlibs:Depends} +Description: development files for libpostproc + This is the video postprocessing library from the ffmpeg project. + . + This package contains the header files and static libraries needed to + compile applications or shared objects that use libpostproc. + +Package: libavformat-dev +Section: libdevel +Architecture: any +Depends: libavformat1d (= ${Source-Version}), libavcodec-dev (= ${Source-Version}), ${shlibs:Depends} +Conflicts: libavcodec-dev (<< 0.cvs20060306-1) +Replaces: libavcodec-dev (<< 0.cvs20060306-1) +Description: development files for libavformat + This is the demuxer library from the ffmpeg project. It supports most + existing file formats (AVI, MPEG, OGG, Matroska, ASF...). + . + This package contains the header files and static libraries needed to + compile applications or shared objects that use libavformat. + +Package: libswscale-dev +Section: libdevel +Architecture: any +Depends: libswscale1d (= ${Source-Version}), libavutil-dev (= ${Source-Version}), ${shlibs:Depends} +Description: development files for libswscale + This is the video scaling library from the ffmpeg project. + . + This package contains the header files and static libraries needed to + compile applications or shared objects that use libswscale. + --- ffmpeg-0.cvs20070307.orig/debian/libavformat-dev.install +++ ffmpeg-0.cvs20070307/debian/libavformat-dev.install @@ -0,0 +1,8 @@ +usr/lib/pkgconfig/libavformat.pc +usr/include/ffmpeg/avformat.h +usr/include/ffmpeg/avio.h +usr/include/ffmpeg/rtp.h +usr/include/ffmpeg/rtsp.h +usr/include/ffmpeg/rtspcodes.h +usr/lib/libavformat.a +usr/lib/libavformat.so --- ffmpeg-0.cvs20070307.orig/doc/hooks.texi +++ ffmpeg-0.cvs20070307/doc/hooks.texi @@ -17,8 +17,8 @@ Any number of hook modules can be placed inline, and they are run in the order that they were specified on the ffmpeg command line. -The video hook modules are provided for use as a base for your own modules, -and are described below. +A few modules are provided and are described below. They are all intended to +be used as a base for your own modules. Modules are loaded using the -vhook option to ffmpeg. The value of this parameter is a space separated list of arguments. The first is the module name, and the rest @@ -48,7 +48,7 @@ This module implements a text overlay for a video image. Currently it supports a fixed overlay or reading the text from a file. The string -is passed through strftime() so that it is easy to imprint the date and +is passed through strftime so that it is easy to imprint the date and time onto the image. This module depends on the external library imlib2, available on @@ -59,13 +59,7 @@ You may move either the text or the image around your video to create scrolling credits, for example. -The font file used is looked for in a FONTPATH environment variable, and -prepended to the point size as a command line option and can be specified -with the full path to the font file, as in: -@example --F /usr/X11R6/lib/X11/fonts/TTF/VeraBd.ttf/20 -@end example -where 20 is the point size. +Text fonts are being looked for in a FONTPATH environment variable. Options: @multitable @columnfractions .2 .8 @@ -73,8 +67,8 @@ @item @option{-F } @tab The font face and size @item @option{-t } @tab The text @item @option{-f } @tab The filename to read text from -@item @option{-x } @tab x coordinate of text or image -@item @option{-y } @tab y coordinate of text or image +@item @option{-x } @tab X coordinate of text or image +@item @option{-y } @tab Y coordinate of text or image @item @option{-i } @tab The filename to read a image from @end multitable @@ -111,53 +105,13 @@ ffmpeg -i input.avi -vhook \ 'vhook/imlib2.dll -c red -F Vera.ttf/20 -x 150+0.5*N -y 70+0.25*N -t Hello' \ -acodec copy -sameq output.avi - - # Date and time stamp, security-camera style: - ffmpeg -r 29.97 -s 320x256 -f video4linux -i /dev/video0 \ - -vhook 'vhook/imlib2.so -x 0 -y 0 -i black-260x20.png' \ - -vhook 'vhook/imlib2.so -c white -F VeraBd.ttf/12 -x 0 -y 0 -t %A-%D-%T' \ - output.avi - - In this example the video is captured from the first video capture card as a - 320x256 AVI, and a black 260 by 20 pixel PNG image is placed in the upper - left corner, with the day, date and time overlaid on it in Vera Bold 12 - point font. A simple black PNG file 260 pixels wide and 20 pixels tall - was created in the GIMP for this purpose. - - # Scrolling credits from a text file - ffmpeg -i input.avi -vhook \ - 'vhook/imlib2.so -c white -F VeraBd.ttf/16 -x 100 -y -1.0*N -f credits.txt' \ - -sameq output.avi - - In this example, the text is stored in a file, and is positioned 100 - pixels from the left hand edge of the video. The text is scrolled from the - bottom up. Making the y factor positive will scroll from the top down. - Increasing the magnitude of the y factor makes the text scroll faster, - decreasing it makes it scroll slower. Hint: Blank lines containing only - a newline are treated as end-of-file. To create blank lines, use lines - that consist of space characters only. - - # scrolling credits from a graphics file - ffmpeg -sameq -i input.avi \ - -vhook 'vhook/imlib2.so -x 0 -y -1.0*N -i credits.png' output.avi - - In this example, a transparent PNG file the same width as the video - (e.g. 320 pixels), but very long, (e.g. 3000 pixels), was created, and - text, graphics, brushstrokes, etc, were added to the image. The image - is then scrolled up, from the bottom of the frame. - @end example @section ppm.c It's basically a launch point for a PPM pipe, so you can use any executable (or script) which consumes a PPM on stdin and produces a PPM -on stdout (and flushes each frame). The Netpbm utilities are a series of -such programs. - -A list of them is here: - -@url{http://netpbm.sourceforge.net/doc/directory.html} +on stdout (and flushes each frame). Usage example: @@ -165,96 +119,4 @@ ffmpeg -i input -vhook "/path/to/ppm.so some-ppm-filter args" output @end example -@section drawtext.c - -This module implements a text overlay for a video image. Currently it -supports a fixed overlay or reading the text from a file. The string -is passed through strftime() so that it is easy to imprint the date and -time onto the image. - -Features: -@itemize @minus -@item TrueType, Type1 and others via the FreeType2 library -@item Font kerning (better output) -@item Line Wrap (put the text that doesn't fit one line on the next line) -@item Background box (currently in development) -@item Outline -@end itemize - -Options: -@multitable @columnfractions .2 .8 -@item @option{-c } @tab Foreground color of the text ('internet' way) <#RRGGBB> [default #FFFFFF] -@item @option{-C } @tab Background color of the text ('internet' way) <#RRGGBB> [default #000000] -@item @option{-f } @tab font file to use -@item @option{-t } @tab text to display -@item @option{-T } @tab file to read text from -@item @option{-x } @tab x coordinate of the start of the text -@item @option{-y } @tab y coordinate of the start of the text -@end multitable - -Text fonts are being looked for in a FONTPATH environment variable. -If the FONTPATH environment variable is not available, or is not checked by -your target (i.e. Cygwin), then specify the full path to the font file as in: -@example --f /usr/X11R6/lib/X11/fonts/TTF/VeraBd.ttf -@end example - -Usage Example: -@example - # Remember to set the path to your fonts - FONTPATH="/cygdrive/c/WINDOWS/Fonts/" - FONTPATH="$FONTPATH:/usr/share/imlib2/data/fonts/" - FONTPATH="$FONTPATH:/usr/X11R6/lib/X11/fonts/TTF/" - export FONTPATH - - # Time and date display - ffmpeg -f video4linux2 -i /dev/video0 \ - -vhook 'vhook/drawtext.so -f VeraBd.ttf -t %A-%D-%T' movie.mpg - - This example grabs video from the first capture card and outputs it to an - MPEG video, and places "Weekday-dd/mm/yy-hh:mm:ss" at the top left of the - frame, updated every second, using the Vera Bold TrueType Font, which - should exist in: /usr/X11R6/lib/X11/fonts/TTF/ -@end example - -Check the man page for strftime() for all the various ways you can format -the date and time. - -@section watermark.c - -Command Line options: -@multitable @columnfractions .2 .8 -@item @option{-m [0|1]} @tab Mode (default: 0, see below) -@item @option{-t 000000 - FFFFFF} @tab Threshold, six digit hex number -@item @option{-f } @tab Watermark image filename, must be specified! -@end multitable - -MODE 0: - The watermark picture works like this (assuming color intensities 0..0xFF): - Per color do this: - If mask color is 0x80, no change to the original frame. - If mask color is < 0x80 the absolute difference is subtracted from the - frame. If result < 0, result = 0. - If mask color is > 0x80 the absolute difference is added to the - frame. If result > 0xFF, result = 0xFF. - - You can override the 0x80 level with the -t flag. E.g. if threshold is - 000000 the color value of watermark is added to the destination. - - This way a mask that is visible both in light and dark pictures can be made - (e.g. by using a picture generated by the Gimp and the bump map tool). - - An example watermark file is at: - @url{http://engene.se/ffmpeg_watermark.gif} - -MODE 1: - Per color do this: - If mask color > threshold color then the watermark pixel is used. - -Example usage: -@example - ffmpeg -i infile -vhook '/path/watermark.so -f wm.gif' -an out.mov - ffmpeg -i infile -vhook '/path/watermark.so -f wm.gif -m 1 -t 222222' -an out.mov -@end example - @bye