diff mplayer Arch Linux Revision 326438643866 (Thu Jul 16 2009 at 15:03) - Diff Link to this snippet: https://friendpaste.com/6JgZsbPEH80zirD88rTazL Embed: manni perldoc borland colorful default murphy trac fruity autumn bw emacs pastie friendly Show line numbers Wrap lines 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431diff -r mplayer-export-arch/libavcodec/Makefile mplayer-export-svn/libavcodec/Makefile38a39> OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o aacpsy.o aactab.o psymodel.o iirfilter.o mdct.o fft.o mpeg4audio.o105c106< OBJS-$(CONFIG_H263_VAAPI_HWACCEL) += h263dec.o h263.o h263_parser.o mpeg12data.o mpegvideo.o error_resilience.o vaapi_mpeg4.o---> OBJS-$(CONFIG_H263_VAAPI_HWACCEL) += vaapi_mpeg4.o111d111< OBJS-$(CONFIG_H264_VDPAU_DECODER) += h264.o h264idct.o h264pred.o h264_parser.o cabac.o mpegvideo.o error_resilience.o143,144d142< OBJS-$(CONFIG_MPEG_VDPAU_DECODER) += mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o< OBJS-$(CONFIG_MPEG1_VDPAU_DECODER) += mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o149c147< OBJS-$(CONFIG_MPEG2_VAAPI_HWACCEL) += mpeg12.o mpeg12data.o mpegvideo.o error_resilience.o vaapi_mpeg2.o---> OBJS-$(CONFIG_MPEG2_VAAPI_HWACCEL) += vaapi_mpeg2.o154c152< OBJS-$(CONFIG_MPEG4_VAAPI_HWACCEL) += h263dec.o h263.o mpeg4video_parser.o mpeg12data.o mpegvideo.o error_resilience.o vaapi_mpeg4.o---> OBJS-$(CONFIG_MPEG4_VAAPI_HWACCEL) += vaapi_mpeg4.o242,243c240< OBJS-$(CONFIG_VC1_VAAPI_HWACCEL) += vc1dec.o vc1.o vc1data.o vc1dsp.o msmpeg4data.o h263dec.o h263.o intrax8.o intrax8dsp.o error_resilience.o mpegvideo.o msmpeg4.o vaapi_vc1.o< OBJS-$(CONFIG_VC1_VDPAU_DECODER) += vc1dec.o vc1.o vc1data.o vc1dsp.o msmpeg4data.o h263dec.o h263.o intrax8.o intrax8dsp.o error_resilience.o mpegvideo.o msmpeg4.o---> OBJS-$(CONFIG_VC1_VAAPI_HWACCEL) += vaapi_vc1.o267,268c264< OBJS-$(CONFIG_WMV3_VAAPI_HWACCEL) += vc1dec.o vc1.o vc1data.o vc1dsp.o msmpeg4data.o h263dec.o h263.o intrax8.o intrax8dsp.o error_resilience.o mpegvideo.o msmpeg4.o vaapi_vc1.o< OBJS-$(CONFIG_WMV3_VDPAU_DECODER) += vc1dec.o vc1.o vc1data.o vc1dsp.o msmpeg4data.o h263dec.o h263.o intrax8.o intrax8dsp.o error_resilience.o mpegvideo.o msmpeg4.o---> OBJS-$(CONFIG_WMV3_VAAPI_HWACCEL) += vaapi_vc1.o385,402c381,400< OBJS-$(CONFIG_LIBAMR_NB) += libamr.o< OBJS-$(CONFIG_LIBAMR_WB) += libamr.o< OBJS-$(CONFIG_LIBDIRAC_DECODER) += libdiracdec.o< OBJS-$(CONFIG_LIBDIRAC_ENCODER) += libdiracenc.o libdirac_libschro.o< OBJS-$(CONFIG_LIBFAAC) += libfaac.o< OBJS-$(CONFIG_LIBFAAD) += libfaad.o< OBJS-$(CONFIG_LIBGSM) += libgsm.o< OBJS-$(CONFIG_LIBMP3LAME) += libmp3lame.o< OBJS-$(CONFIG_LIBOPENCORE_AMRNB) += libopencore-amr.o< OBJS-$(CONFIG_LIBOPENCORE_AMRWB) += libopencore-amr.o< OBJS-$(CONFIG_LIBOPENJPEG) += libopenjpeg.o< OBJS-$(CONFIG_LIBSCHROEDINGER_DECODER) += libschroedingerdec.o libschroedinger.o libdirac_libschro.o< OBJS-$(CONFIG_LIBSCHROEDINGER_ENCODER) += libschroedingerenc.o libschroedinger.o libdirac_libschro.o< OBJS-$(CONFIG_LIBSPEEX) += libspeexdec.o< OBJS-$(CONFIG_LIBTHEORA) += libtheoraenc.o< OBJS-$(CONFIG_LIBVORBIS) += libvorbis.o< OBJS-$(CONFIG_LIBX264) += libx264.o< OBJS-$(CONFIG_LIBXVID) += libxvidff.o libxvid_rc.o---> OBJS-$(CONFIG_LIBDIRAC_DECODER) += libdiracdec.o> OBJS-$(CONFIG_LIBDIRAC_ENCODER) += libdiracenc.o libdirac_libschro.o> OBJS-$(CONFIG_LIBFAAC_ENCODER) += libfaac.o> OBJS-$(CONFIG_LIBFAAD_DECODER) += libfaad.o> OBJS-$(CONFIG_LIBGSM_DECODER) += libgsm.o> OBJS-$(CONFIG_LIBGSM_ENCODER) += libgsm.o> OBJS-$(CONFIG_LIBGSM_MS_DECODER) += libgsm.o> OBJS-$(CONFIG_LIBGSM_MS_ENCODER) += libgsm.o> OBJS-$(CONFIG_LIBMP3LAME_ENCODER) += libmp3lame.o> OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER) += libopencore-amr.o> OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER) += libopencore-amr.o> OBJS-$(CONFIG_LIBOPENCORE_AMRWB_ENCODER) += libopencore-amr.o> OBJS-$(CONFIG_LIBOPENJPEG_DECODER) += libopenjpeg.o> OBJS-$(CONFIG_LIBSCHROEDINGER_DECODER) += libschroedingerdec.o libschroedinger.o libdirac_libschro.o> OBJS-$(CONFIG_LIBSCHROEDINGER_ENCODER) += libschroedingerenc.o libschroedinger.o libdirac_libschro.o> OBJS-$(CONFIG_LIBSPEEX_DECODER) += libspeexdec.o> OBJS-$(CONFIG_LIBTHEORA_ENCODER) += libtheoraenc.o> OBJS-$(CONFIG_LIBVORBIS_ENCODER) += libvorbis.o> OBJS-$(CONFIG_LIBX264_ENCODER) += libx264.o> OBJS-$(CONFIG_LIBXVID_ENCODER) += libxvidff.o libxvid_rc.odiff -r mplayer-export-arch/libavcodec/aac.c mplayer-export-svn/libavcodec/aac.c201a202,203> ac->output_configured = 1;> 448,453d449< enum ChannelPosition new_che_pos[4][MAX_ELEM_ID];< memset(new_che_pos, 0, 4 * MAX_ELEM_ID * sizeof(new_che_pos[0][0]));< if(set_default_channel_config(ac, new_che_pos, avccontext->channels - (avccontext->channels == 8)))< return -1;< if(output_configure(ac, ac->che_pos, new_che_pos, 1))< return -1;1582c1578,1580< if (hdr_info.chan_config)---> if (!ac->output_configured && hdr_info.chan_config) {> enum ChannelPosition new_che_pos[4][MAX_ELEM_ID];> memset(new_che_pos, 0, 4 * MAX_ELEM_ID * sizeof(new_che_pos[0][0]));1583a1582,1586> if (set_default_channel_config(ac, new_che_pos, hdr_info.chan_config))> return -7;> if (output_configure(ac, ac->che_pos, new_che_pos, 1))> return -7;> }1658c1661,1665< err = output_configure(ac, ac->che_pos, new_che_pos, 0);---> if (ac->output_configured)> av_log(avccontext, AV_LOG_ERROR,> "Not evaluating a further program_config_element as this construct is dubious at best.\n");> else> err = output_configure(ac, ac->che_pos, new_che_pos, 0);diff -r mplayer-export-arch/libavcodec/aac.h mplayer-export-svn/libavcodec/aac.h118a119,124> #define SCALE_DIV_512 36 ///< scalefactor difference that corresponds to scale difference in 512 times> #define SCALE_ONE_POS 140 ///< scalefactor index that corresponds to scale=1.0> #define SCALE_MAX_POS 255 ///< scalefactor index maximum value> #define SCALE_MAX_DIFF 60 ///< maximum scalefactor difference allowed by standard> #define SCALE_DIFF_ZERO 60 ///< codebook index corresponding to zero scalefactor indices difference> 128a135> const uint8_t *swb_sizes; ///< table of scalefactor band sizes for a particular window167a175> int start;192c200,201< enum BandType band_type[120]; ///< band types---> Pulse pulse;> enum BandType band_type[128]; ///< band types194a204,205> int sf_idx[128]; ///< scalefactor indices (used by encoder)> uint8_t zeroes[128]; ///< band is not coded (used by encoder)196c207< DECLARE_ALIGNED_16(float, saved[512]); ///< overlap---> DECLARE_ALIGNED_16(float, saved[1024]); ///< overlap206c217,219< uint8_t ms_mask[120]; ///< Set if mid/side stereo is used for each scalefactor window band---> int common_window; ///< Set if channels share a common 'IndividualChannelStream' in bitstream.> int ms_mode; ///< Signals mid/side stereo flags coding mode (used by encoder)> uint8_t ms_mask[128]; ///< Set if mid/side stereo is used for each scalefactor window band263a277,278> > int output_configured;Only in mplayer-export-svn/libavcodec: aaccoder.cdiff -r mplayer-export-arch/libavcodec/aacenc.c mplayer-export-svn/libavcodec/aacenc.c29d28< * psy model selection with some option35c34< #include "get_bits.h"---> #include "put_bits.h"39d37< #include "aacpsy.h"41a40,42> #include "aacenc.h"> > #include "psymodel.h"86c87< static const uint8_t * const swb_size_1024[] = {---> static const uint8_t *swb_size_1024[] = {113c114< static const uint8_t * const swb_size_128[] = {---> static const uint8_t *swb_size_128[] = {122,138d122< /** bits needed to code codebook run value for long windows */< static const uint8_t run_value_bits_long[64] = {< 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,< 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10,< 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,< 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 15< };< < /** bits needed to code codebook run value for short windows */< static const uint8_t run_value_bits_short[16] = {< 3, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 9< };< < static const uint8_t* const run_value_bits[2] = {< run_value_bits_long, run_value_bits_short< };< 150,176d133< * structure used in optimal codebook search< */< typedef struct BandCodingPath {< int prev_idx; ///< pointer to the previous path point< int codebook; ///< codebook for coding band run< int bits; ///< number of bit needed to code given number of bands< } BandCodingPath;< < /**< * AAC encoder context< */< typedef struct {< PutBitContext pb;< MDCTContext mdct1024; ///< long (1024 samples) frame transform context< MDCTContext mdct128; ///< short (128 samples) frame transform context< DSPContext dsp;< DECLARE_ALIGNED_16(FFTSample, output[2048]); ///< temporary buffer for MDCT input coefficients< int16_t* samples; ///< saved preprocessed input< < int samplerate_index; ///< MPEG-4 samplerate index< < ChannelElement *cpe; ///< channel elements< AACPsyContext psy; ///< psychoacoustic model context< int last_frame;< } AACEncContext;< < /**199a157,158> const uint8_t *sizes[2];> int lengths[2];203,204c162,163< for(i = 0; i < 16; i++)< if(avctx->sample_rate == ff_mpeg4audio_sample_rates[i])---> for (i = 0; i < 16; i++)> if (avctx->sample_rate == ff_mpeg4audio_sample_rates[i])206c165< if(i == 16){---> if (i == 16) {210c169< if(avctx->channels > 6){---> if (avctx->channels > 6) {225,233c184,186< s->samples = av_malloc(2 * 1024 * avctx->channels * sizeof(s->samples[0]));< s->cpe = av_mallocz(sizeof(ChannelElement) * aac_chan_configs[avctx->channels-1][0]);< if(ff_aac_psy_init(&s->psy, avctx, AAC_PSY_3GPP,< aac_chan_configs[avctx->channels-1][0], 0,< swb_size_1024[i], ff_aac_num_swb_1024[i], swb_size_128[i], ff_aac_num_swb_128[i]) < 0){< av_log(avctx, AV_LOG_ERROR, "Cannot initialize selected model.\n");< return -1;< }< avctx->extradata = av_malloc(2);---> s->samples = av_malloc(2 * 1024 * avctx->channels * sizeof(s->samples[0]));> s->cpe = av_mallocz(sizeof(ChannelElement) * aac_chan_configs[avctx->channels-1][0]);> avctx->extradata = av_malloc(2);235a189,207> > sizes[0] = swb_size_1024[i];> sizes[1] = swb_size_128[i];> lengths[0] = ff_aac_num_swb_1024[i];> lengths[1] = ff_aac_num_swb_128[i];> ff_psy_init(&s->psy, avctx, 2, sizes, lengths);> s->psypp = ff_psy_preprocess_init(avctx);> s->coder = &ff_aac_coders[0];> > s->lambda = avctx->global_quality ? avctx->global_quality : 120;> #if !CONFIG_HARDCODED_TABLES> for (i = 0; i < 428; i++)> ff_aac_pow2sf_tab[i] = pow(2, (i - 200)/4.);> #endif /* CONFIG_HARDCODED_TABLES */> > if (avctx->channels > 5)> av_log(avctx, AV_LOG_ERROR, "This encoder does not yet enforce the restrictions on LFEs. "> "The output will most likely be an illegal bitstream.\n");> 238a211,262> static void apply_window_and_mdct(AVCodecContext *avctx, AACEncContext *s,> SingleChannelElement *sce, short *audio, int channel)> {> int i, j, k;> const float * lwindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024;> const float * swindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128;> const float * pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;> > if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) {> memcpy(s->output, sce->saved, sizeof(float)*1024);> if (sce->ics.window_sequence[0] == LONG_STOP_SEQUENCE) {> memset(s->output, 0, sizeof(s->output[0]) * 448);> for (i = 448; i < 576; i++)> s->output[i] = sce->saved[i] * pwindow[i - 448];> for (i = 576; i < 704; i++)> s->output[i] = sce->saved[i];> }> if (sce->ics.window_sequence[0] != LONG_START_SEQUENCE) {> j = channel;> for (i = 0; i < 1024; i++, j += avctx->channels) {> s->output[i+1024] = audio[j] * lwindow[1024 - i - 1];> sce->saved[i] = audio[j] * lwindow[i];> }> } else {> j = channel;> for (i = 0; i < 448; i++, j += avctx->channels)> s->output[i+1024] = audio[j];> for (i = 448; i < 576; i++, j += avctx->channels)> s->output[i+1024] = audio[j] * swindow[576 - i - 1];> memset(s->output+1024+576, 0, sizeof(s->output[0]) * 448);> j = channel;> for (i = 0; i < 1024; i++, j += avctx->channels)> sce->saved[i] = audio[j];> }> ff_mdct_calc(&s->mdct1024, sce->coeffs, s->output);> } else {> j = channel;> for (k = 0; k < 1024; k += 128) {> for (i = 448 + k; i < 448 + k + 256; i++)> s->output[i - 448 - k] = (i < 1024)> ? sce->saved[i]> : audio[channel + (i-1024)*avctx->channels];> s->dsp.vector_fmul (s->output, k ? swindow : pwindow, 128);> s->dsp.vector_fmul_reverse(s->output+128, s->output+128, swindow, 128);> ff_mdct_calc(&s->mdct128, sce->coeffs + k, s->output);> }> j = channel;> for (i = 0; i < 1024; i++, j += avctx->channels)> sce->saved[i] = audio[j];> }> }> 245c269< int i;---> int w;250c274< if(info->window_sequence[0] != EIGHT_SHORT_SEQUENCE){---> if (info->window_sequence[0] != EIGHT_SHORT_SEQUENCE) {253c277< }else{---> } else {255,256c279,342< for(i = 1; i < info->num_windows; i++)< put_bits(&s->pb, 1, info->group_len[i]);---> for (w = 1; w < 8; w++)> put_bits(&s->pb, 1, !info->group_len[w]);> }> }> > /**> * Encode MS data.> * @see 4.6.8.1 "Joint Coding - M/S Stereo"> */> static void encode_ms_info(PutBitContext *pb, ChannelElement *cpe)> {> int i, w;> > put_bits(pb, 2, cpe->ms_mode);> if (cpe->ms_mode == 1)> for (w = 0; w < cpe->ch[0].ics.num_windows; w += cpe->ch[0].ics.group_len[w])> for (i = 0; i < cpe->ch[0].ics.max_sfb; i++)> put_bits(pb, 1, cpe->ms_mask[w*16 + i]);> }> > /**> * Produce integer coefficients from scalefactors provided by the model.> */> static void adjust_frame_information(AACEncContext *apc, ChannelElement *cpe, int chans)> {> int i, w, w2, g, ch;> int start, sum, maxsfb, cmaxsfb;> > for (ch = 0; ch < chans; ch++) {> IndividualChannelStream *ics = &cpe->ch[ch].ics;> start = 0;> maxsfb = 0;> cpe->ch[ch].pulse.num_pulse = 0;> for (w = 0; w < ics->num_windows*16; w += 16) {> for (g = 0; g < ics->num_swb; g++) {> sum = 0;> //apply M/S> if (!ch && cpe->ms_mask[w + g]) {> for (i = 0; i < ics->swb_sizes[g]; i++) {> cpe->ch[0].coeffs[start+i] = (cpe->ch[0].coeffs[start+i] + cpe->ch[1].coeffs[start+i]) / 2.0;> cpe->ch[1].coeffs[start+i] = cpe->ch[0].coeffs[start+i] - cpe->ch[1].coeffs[start+i];> }> }> start += ics->swb_sizes[g];> }> for (cmaxsfb = ics->num_swb; cmaxsfb > 0 && cpe->ch[ch].zeroes[w+cmaxsfb-1]; cmaxsfb--)> ;> maxsfb = FFMAX(maxsfb, cmaxsfb);> }> ics->max_sfb = maxsfb;> > //adjust zero bands for window groups> for (w = 0; w < ics->num_windows; w += ics->group_len[w]) {> for (g = 0; g < ics->max_sfb; g++) {> i = 1;> for (w2 = w; w2 < w + ics->group_len[w]; w2++) {> if (!cpe->ch[ch].zeroes[w2*16 + g]) {> i = 0;> break;> }> }> cpe->ch[ch].zeroes[w*16 + g] = i;> }> }257a344,370> > if (chans > 1 && cpe->common_window) {> IndividualChannelStream *ics0 = &cpe->ch[0].ics;> IndividualChannelStream *ics1 = &cpe->ch[1].ics;> int msc = 0;> ics0->max_sfb = FFMAX(ics0->max_sfb, ics1->max_sfb);> ics1->max_sfb = ics0->max_sfb;> for (w = 0; w < ics0->num_windows*16; w += 16)> for (i = 0; i < ics0->max_sfb; i++)> if (cpe->ms_mask[w+i])> msc++;> if (msc == 0 || ics0->max_sfb == 0)> cpe->ms_mode = 0;> else> cpe->ms_mode = msc < ics0->max_sfb ? 1 : 2;> }> }> > /**> * Encode scalefactor band coding type.> */> static void encode_band_info(AACEncContext *s, SingleChannelElement *sce)> {> int w;> > for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w])> s->coder->encode_window_bands_info(s, sce, w, sce->ics.group_len[w], s->lambda);261c374< * Calculate the number of bits needed to code all coefficient signs in current band.---> * Encode scalefactors.263,264c376,377< static int calculate_band_sign_bits(AACEncContext *s, SingleChannelElement *sce,< int group_len, int start, int size)---> static void encode_scale_factors(AVCodecContext *avctx, AACEncContext *s,> SingleChannelElement *sce)266c379< int bits = 0;---> int off = sce->sf_idx[0], diff;268,271c381,390< for(w = 0; w < group_len; w++){< for(i = 0; i < size; i++){< if(sce->icoefs[start + i])< bits++;---> > for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {> for (i = 0; i < sce->ics.max_sfb; i++) {> if (!sce->zeroes[w*16 + i]) {> diff = sce->sf_idx[w*16 + i] - off + SCALE_DIFF_ZERO;> if (diff < 0 || diff > 120)> av_log(avctx, AV_LOG_ERROR, "Scalefactor difference is too big to be coded\n");> off = sce->sf_idx[w*16 + i];> put_bits(&s->pb, ff_aac_scalefactor_bits[diff], ff_aac_scalefactor_code[diff]);> }273d391< start += 128;275d392< return bits;286c403,404< if(!pulse->num_pulse) return;---> if (!pulse->num_pulse)> return;290c408< for(i = 0; i < pulse->num_pulse; i++){---> for (i = 0; i < pulse->num_pulse; i++) {301c419< int start, i, w, w2, wg;---> int start, i, w, w2;303,304c421< w = 0;< for(wg = 0; wg < sce->ics.num_window_groups; wg++){---> for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {306,307c423,424< for(i = 0; i < sce->ics.max_sfb; i++){< if(sce->zeroes[w*16 + i]){---> for (i = 0; i < sce->ics.max_sfb; i++) {> if (sce->zeroes[w*16 + i]) {311,315c428,433< for(w2 = w; w2 < w + sce->ics.group_len[wg]; w2++){< encode_band_coeffs(s, sce, start + w2*128,< sce->ics.swb_sizes[i],< sce->band_type[w*16 + i]);< }---> for (w2 = w; w2 < w + sce->ics.group_len[w]; w2++)> s->coder->quantize_and_encode_band(s, &s->pb, sce->coeffs + start + w2*128,> sce->ics.swb_sizes[i],> sce->sf_idx[w*16 + i],> sce->band_type[w*16 + i],> s->lambda);318d435< w += sce->ics.group_len[wg];322a440,458> * Encode one channel of audio data.> */> static int encode_individual_channel(AVCodecContext *avctx, AACEncContext *s,> SingleChannelElement *sce,> int common_window)> {> put_bits(&s->pb, 8, sce->sf_idx[0]);> if (!common_window)> put_ics_info(s, &sce->ics);> encode_band_info(s, sce);> encode_scale_factors(avctx, s, sce);> encode_pulses(s, &sce->pulse);> put_bits(&s->pb, 1, 0); //tns> put_bits(&s->pb, 1, 0); //ssr> encode_spectral_coeffs(s, sce);> return 0;> }> > /**325c461,462< static void put_bitstream_info(AVCodecContext *avctx, AACEncContext *s, const char *name)---> static void put_bitstream_info(AVCodecContext *avctx, AACEncContext *s,> const char *name)332c469< if(namelen >= 15)---> if (namelen >= 15)337c474< for(i = 0; i < namelen - 2; i++)---> for (i = 0; i < namelen - 2; i++)341a479,616> static int aac_encode_frame(AVCodecContext *avctx,> uint8_t *frame, int buf_size, void *data)> {> AACEncContext *s = avctx->priv_data;> int16_t *samples = s->samples, *samples2, *la;> ChannelElement *cpe;> int i, j, chans, tag, start_ch;> const uint8_t *chan_map = aac_chan_configs[avctx->channels-1];> int chan_el_counter[4];> FFPsyWindowInfo windows[avctx->channels];> > if (s->last_frame)> return 0;> if (data) {> if (!s->psypp) {> memcpy(s->samples + 1024 * avctx->channels, data,> 1024 * avctx->channels * sizeof(s->samples[0]));> } else {> start_ch = 0;> samples2 = s->samples + 1024 * avctx->channels;> for (i = 0; i < chan_map[0]; i++) {> tag = chan_map[i+1];> chans = tag == TYPE_CPE ? 2 : 1;> ff_psy_preprocess(s->psypp, (uint16_t*)data + start_ch,> samples2 + start_ch, start_ch, chans);> start_ch += chans;> }> }> }> if (!avctx->frame_number) {> memcpy(s->samples, s->samples + 1024 * avctx->channels,> 1024 * avctx->channels * sizeof(s->samples[0]));> return 0;> }> > start_ch = 0;> for (i = 0; i < chan_map[0]; i++) {> FFPsyWindowInfo* wi = windows + start_ch;> tag = chan_map[i+1];> chans = tag == TYPE_CPE ? 2 : 1;> cpe = &s->cpe[i];> samples2 = samples + start_ch;> la = samples2 + 1024 * avctx->channels + start_ch;> if (!data)> la = NULL;> for (j = 0; j < chans; j++) {> IndividualChannelStream *ics = &cpe->ch[j].ics;> int k;> wi[j] = ff_psy_suggest_window(&s->psy, samples2, la, start_ch + j, ics->window_sequence[0]);> ics->window_sequence[1] = ics->window_sequence[0];> ics->window_sequence[0] = wi[j].window_type[0];> ics->use_kb_window[1] = ics->use_kb_window[0];> ics->use_kb_window[0] = wi[j].window_shape;> ics->num_windows = wi[j].num_windows;> ics->swb_sizes = s->psy.bands [ics->num_windows == 8];> ics->num_swb = s->psy.num_bands[ics->num_windows == 8];> for (k = 0; k < ics->num_windows; k++)> ics->group_len[k] = wi[j].grouping[k];> > s->cur_channel = start_ch + j;> apply_window_and_mdct(avctx, s, &cpe->ch[j], samples2, j);> }> start_ch += chans;> }> do {> int frame_bits;> init_put_bits(&s->pb, frame, buf_size*8);> if ((avctx->frame_number & 0xFF)==1 && !(avctx->flags & CODEC_FLAG_BITEXACT))> put_bitstream_info(avctx, s, LIBAVCODEC_IDENT);> start_ch = 0;> memset(chan_el_counter, 0, sizeof(chan_el_counter));> for (i = 0; i < chan_map[0]; i++) {> FFPsyWindowInfo* wi = windows + start_ch;> tag = chan_map[i+1];> chans = tag == TYPE_CPE ? 2 : 1;> cpe = &s->cpe[i];> for (j = 0; j < chans; j++) {> s->coder->search_for_quantizers(avctx, s, &cpe->ch[j], s->lambda);> }> cpe->common_window = 0;> if (chans > 1> && wi[0].window_type[0] == wi[1].window_type[0]> && wi[0].window_shape == wi[1].window_shape) {> > cpe->common_window = 1;> for (j = 0; j < wi[0].num_windows; j++) {> if (wi[0].grouping[j] != wi[1].grouping[j]) {> cpe->common_window = 0;> break;> }> }> }> if (cpe->common_window && s->coder->search_for_ms)> s->coder->search_for_ms(s, cpe, s->lambda);> adjust_frame_information(s, cpe, chans);> put_bits(&s->pb, 3, tag);> put_bits(&s->pb, 4, chan_el_counter[tag]++);> if (chans == 2) {> put_bits(&s->pb, 1, cpe->common_window);> if (cpe->common_window) {> put_ics_info(s, &cpe->ch[0].ics);> encode_ms_info(&s->pb, cpe);> }> }> for (j = 0; j < chans; j++) {> s->cur_channel = start_ch + j;> ff_psy_set_band_info(&s->psy, s->cur_channel, cpe->ch[j].coeffs, &wi[j]);> encode_individual_channel(avctx, s, &cpe->ch[j], cpe->common_window);> }> start_ch += chans;> }> > frame_bits = put_bits_count(&s->pb);> if (frame_bits <= 6144 * avctx->channels - 3)> break;> > s->lambda *= avctx->bit_rate * 1024.0f / avctx->sample_rate / frame_bits;> > } while (1);> > put_bits(&s->pb, 3, TYPE_END);> flush_put_bits(&s->pb);> avctx->frame_bits = put_bits_count(&s->pb);> > // rate control stuff> if (!(avctx->flags & CODEC_FLAG_QSCALE)) {> float ratio = avctx->bit_rate * 1024.0f / avctx->sample_rate / avctx->frame_bits;> s->lambda *= ratio;> s->lambda = FFMIN(s->lambda, 65536.f);> }> > if (!data)> s->last_frame = 1;> memcpy(s->samples, s->samples + 1024 * avctx->channels,> 1024 * avctx->channels * sizeof(s->samples[0]));> return put_bits_count(&s->pb)>>3;> }> 348c623,624< ff_aac_psy_end(&s->psy);---> ff_psy_end(&s->psy);> ff_psy_preprocess_end(s->psypp);Only in mplayer-export-svn/libavcodec: aacenc.hdiff -r mplayer-export-arch/libavcodec/aacpsy.c mplayer-export-svn/libavcodec/aacpsy.c28d27< #include "aacpsy.h"29a29> #include "psymodel.h"33,38d32< * General:< * better audio preprocessing (add DC highpass filter?)< * more psy models< * maybe improve coefficient quantization function in some way< *< * 3GPP-based psy model:45,70d38< * Quantize one coefficient.< * @return absolute value of the quantized coefficient< * @see 3GPP TS26.403 5.6.2 "Scalefactor determination"< */< static av_always_inline int quant(float coef, const float Q)< {< return av_clip((int)(pow(fabsf(coef) * Q, 0.75) + 0.4054), 0, 8191);< }< < static inline float get_approximate_quant_error(float *c, int size, int scale_idx)< {< int i;< int q;< float coef, unquant, sum = 0.0f;< const float Q = ff_aac_pow2sf_tab[200 - scale_idx + SCALE_ONE_POS - SCALE_DIV_512];< const float IQ = ff_aac_pow2sf_tab[200 + scale_idx - SCALE_ONE_POS + SCALE_DIV_512];< for(i = 0; i < size; i++){< coef = fabs(c[i]);< q = quant(c[i], Q);< unquant = (q * cbrt(q)) * IQ;< sum += (coef - unquant) * (coef - unquant);< }< return sum;< }< < /**75a44,46> > #define PSY_3GPP_RPEMIN 0.01f> #define PSY_3GPP_RPELEV 2.0f85a57,59> float thr; ///< energy threshold> float min_snr; ///< minimal SNR> float thr_quiet; ///< threshold in quiet88a63,75> * single/pair channel context for psychoacoustic model> */> typedef struct Psy3gppChannel{> Psy3gppBand band[128]; ///< bands information> Psy3gppBand prev_band[128]; ///< bands information from the previous frame> > float win_energy; ///< sliding average of channel energy> float iir_state[2]; ///< hi-pass IIR filter state> uint8_t next_grouping; ///< stored grouping scheme for the next frame (in case of 8 short window sequence)> enum WindowSequence next_window_seq; ///< window sequence to be used in the next frame> }Psy3gppChannel;> > /**98a86,93> * 3GPP TS26.403-inspired psychoacoustic model specific data> */> typedef struct Psy3gppContext{> Psy3gppCoeffs psy_coef[2];> Psy3gppChannel *ch;> }Psy3gppContext;> > /**101c96< static inline float calc_bark(float f)---> static av_cold float calc_bark(float f)104a100,318> > #define ATH_ADD 4> /**> * Calculate ATH value for given frequency.> * Borrowed from Lame.> */> static av_cold float ath(float f, float add)> {> f /= 1000.0f;> return 3.64 * pow(f, -0.8)> - 6.8 * exp(-0.6 * (f - 3.4) * (f - 3.4))> + 6.0 * exp(-0.15 * (f - 8.7) * (f - 8.7))> + (0.6 + 0.04 * add) * 0.001 * f * f * f * f;> }> > static av_cold int psy_3gpp_init(FFPsyContext *ctx) {> Psy3gppContext *pctx;> float barks[1024];> int i, j, g, start;> float prev, minscale, minath;> > ctx->model_priv_data = av_mallocz(sizeof(Psy3gppContext));> pctx = (Psy3gppContext*) ctx->model_priv_data;> > for (i = 0; i < 1024; i++)> barks[i] = calc_bark(i * ctx->avctx->sample_rate / 2048.0);> minath = ath(3410, ATH_ADD);> for (j = 0; j < 2; j++) {> Psy3gppCoeffs *coeffs = &pctx->psy_coef[j];> i = 0;> prev = 0.0;> for (g = 0; g < ctx->num_bands[j]; g++) {> i += ctx->bands[j][g];> coeffs->barks[g] = (barks[i - 1] + prev) / 2.0;> prev = barks[i - 1];> }> for (g = 0; g < ctx->num_bands[j] - 1; g++) {> coeffs->spread_low[g] = pow(10.0, -(coeffs->barks[g+1] - coeffs->barks[g]) * PSY_3GPP_SPREAD_LOW);> coeffs->spread_hi [g] = pow(10.0, -(coeffs->barks[g+1] - coeffs->barks[g]) * PSY_3GPP_SPREAD_HI);> }> start = 0;> for (g = 0; g < ctx->num_bands[j]; g++) {> minscale = ath(ctx->avctx->sample_rate * start / 1024.0, ATH_ADD);> for (i = 1; i < ctx->bands[j][g]; i++)> minscale = FFMIN(minscale, ath(ctx->avctx->sample_rate * (start + i) / 1024.0 / 2.0, ATH_ADD));> coeffs->ath[g] = minscale - minath;> start += ctx->bands[j][g];> }> }> > pctx->ch = av_mallocz(sizeof(Psy3gppChannel) * ctx->avctx->channels);> return 0;> }> > /**> * IIR filter used in block switching decision> */> static float iir_filter(int in, float state[2])> {> float ret;> > ret = 0.7548f * (in - state[0]) + 0.5095f * state[1];> state[0] = in;> state[1] = ret;> return ret;> }> > /**> * window grouping information stored as bits (0 - new group, 1 - group continues)> */> static const uint8_t window_grouping[9] = {> 0xB6, 0x6C, 0xD8, 0xB2, 0x66, 0xC6, 0x96, 0x36, 0x36> };> > /**> * Tell encoder which window types to use.> * @see 3GPP TS26.403 5.4.1 "Blockswitching"> */> static FFPsyWindowInfo psy_3gpp_window(FFPsyContext *ctx,> const int16_t *audio, const int16_t *la,> int channel, int prev_type)> {> int i, j;> int br = ctx->avctx->bit_rate / ctx->avctx->channels;> int attack_ratio = br <= 16000 ? 18 : 10;> Psy3gppContext *pctx = (Psy3gppContext*) ctx->model_priv_data;> Psy3gppChannel *pch = &pctx->ch[channel];> uint8_t grouping = 0;> FFPsyWindowInfo wi;> > memset(&wi, 0, sizeof(wi));> if (la) {> float s[8], v;> int switch_to_eight = 0;> float sum = 0.0, sum2 = 0.0;> int attack_n = 0;> for (i = 0; i < 8; i++) {> for (j = 0; j < 128; j++) {> v = iir_filter(audio[(i*128+j)*ctx->avctx->channels], pch->iir_state);> sum += v*v;> }> s[i] = sum;> sum2 += sum;> }> for (i = 0; i < 8; i++) {> if (s[i] > pch->win_energy * attack_ratio) {> attack_n = i + 1;> switch_to_eight = 1;> break;> }> }> pch->win_energy = pch->win_energy*7/8 + sum2/64;> > wi.window_type[1] = prev_type;> switch (prev_type) {> case ONLY_LONG_SEQUENCE:> wi.window_type[0] = switch_to_eight ? LONG_START_SEQUENCE : ONLY_LONG_SEQUENCE;> break;> case LONG_START_SEQUENCE:> wi.window_type[0] = EIGHT_SHORT_SEQUENCE;> grouping = pch->next_grouping;> break;> case LONG_STOP_SEQUENCE:> wi.window_type[0] = ONLY_LONG_SEQUENCE;> break;> case EIGHT_SHORT_SEQUENCE:> wi.window_type[0] = switch_to_eight ? EIGHT_SHORT_SEQUENCE : LONG_STOP_SEQUENCE;> grouping = switch_to_eight ? pch->next_grouping : 0;> break;> }> pch->next_grouping = window_grouping[attack_n];> } else {> for (i = 0; i < 3; i++)> wi.window_type[i] = prev_type;> grouping = (prev_type == EIGHT_SHORT_SEQUENCE) ? window_grouping[0] : 0;> }> > wi.window_shape = 1;> if (wi.window_type[0] != EIGHT_SHORT_SEQUENCE) {> wi.num_windows = 1;> wi.grouping[0] = 1;> } else {> int lastgrp = 0;> wi.num_windows = 8;> for (i = 0; i < 8; i++) {> if (!((grouping >> i) & 1))> lastgrp = i;> wi.grouping[lastgrp]++;> }> }> > return wi;> }> > /**> * Calculate band thresholds as suggested in 3GPP TS26.403> */> static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,> const float *coefs, FFPsyWindowInfo *wi)> {> Psy3gppContext *pctx = (Psy3gppContext*) ctx->model_priv_data;> Psy3gppChannel *pch = &pctx->ch[channel];> int start = 0;> int i, w, g;> const int num_bands = ctx->num_bands[wi->num_windows == 8];> const uint8_t* band_sizes = ctx->bands[wi->num_windows == 8];> Psy3gppCoeffs *coeffs = &pctx->psy_coef[wi->num_windows == 8];> > //calculate energies, initial thresholds and related values - 5.4.2 "Threshold Calculation"> for (w = 0; w < wi->num_windows*16; w += 16) {> for (g = 0; g < num_bands; g++) {> Psy3gppBand *band = &pch->band[w+g];> band->energy = 0.0f;> for (i = 0; i < band_sizes[g]; i++)> band->energy += coefs[start+i] * coefs[start+i];> band->energy *= 1.0f / (512*512);> band->thr = band->energy * 0.001258925f;> start += band_sizes[g];> > ctx->psy_bands[channel*PSY_MAX_BANDS+w+g].energy = band->energy;> }> }> //modify thresholds - spread, threshold in quiet - 5.4.3 "Spreaded Energy Calculation"> for (w = 0; w < wi->num_windows*16; w += 16) {> Psy3gppBand *band = &pch->band[w];> for (g = 1; g < num_bands; g++)> band[g].thr = FFMAX(band[g].thr, band[g-1].thr * coeffs->spread_low[g-1]);> for (g = num_bands - 2; g >= 0; g--)> band[g].thr = FFMAX(band[g].thr, band[g+1].thr * coeffs->spread_hi [g]);> for (g = 0; g < num_bands; g++) {> band[g].thr_quiet = FFMAX(band[g].thr, coeffs->ath[g]);> if (wi->num_windows != 8 && wi->window_type[1] != EIGHT_SHORT_SEQUENCE)> band[g].thr_quiet = FFMAX(PSY_3GPP_RPEMIN*band[g].thr_quiet,> FFMIN(band[g].thr_quiet,> PSY_3GPP_RPELEV*pch->prev_band[w+g].thr_quiet));> band[g].thr = FFMAX(band[g].thr, band[g].thr_quiet * 0.25);> > ctx->psy_bands[channel*PSY_MAX_BANDS+w+g].threshold = band[g].thr;> }> }> memcpy(pch->prev_band, pch->band, sizeof(pch->band));> }> > static av_cold void psy_3gpp_end(FFPsyContext *apc)> {> Psy3gppContext *pctx = (Psy3gppContext*) apc->model_priv_data;> av_freep(&pctx->ch);> av_freep(&apc->model_priv_data);> }> > > const FFPsyModel ff_aac_psy_model => {> .name = "3GPP TS 26.403-inspired model",> .init = psy_3gpp_init,> .window = psy_3gpp_window,> .analyze = psy_3gpp_analyze,> .end = psy_3gpp_end,> };diff -r mplayer-export-arch/libavcodec/allcodecs.c mplayer-export-svn/libavcodec/allcodecs.c198c198< REGISTER_DECODER (AAC, aac);---> REGISTER_ENCDEC (AAC, aac);306,307d305< REGISTER_ENCDEC (LIBAMR_NB, libamr_nb);< REGISTER_ENCDEC (LIBAMR_WB, libamr_wb);diff -r mplayer-export-arch/libavcodec/dvbsubdec.c mplayer-export-svn/libavcodec/dvbsubdec.c1307a1308> rect->type = SUBTITLE_BITMAP;diff -r mplayer-export-arch/libavcodec/iirfilter.c mplayer-export-svn/libavcodec/iirfilter.c28d27< #include <complex.h>51c50< struct FFIIRFilterCoeffs* ff_iir_filter_init_coeffs(enum IIRFilterType filt_type,---> av_cold struct FFIIRFilterCoeffs* ff_iir_filter_init_coeffs(enum IIRFilterType filt_type,56c55< int i, j, size;---> int i, j;59c58< complex p[MAXORDER + 1];---> double p[MAXORDER + 1][2];77c76,77< p[0] = 1.0;---> p[0][0] = 1.0;> p[0][1] = 0.0;79c79< p[i] = 0.0;---> p[i][0] = p[i][1] = 0.0;81c81< complex zp;---> double zp[2];83,84c83,91< zp = cexp(I*th) * wa;< zp = (zp + 2.0) / (zp - 2.0);---> double a_re, a_im, c_re, c_im;> zp[0] = cos(th) * wa;> zp[1] = sin(th) * wa;> a_re = zp[0] + 2.0;> c_re = zp[0] - 2.0;> a_im => c_im = zp[1];> zp[0] = (a_re * c_re + a_im * c_im) / (c_re * c_re + c_im * c_im);> zp[1] = (a_im * c_re - a_re * c_im) / (c_re * c_re + c_im * c_im);87,88c94,102< p[j] = zp*p[j] + p[j - 1];< p[0] *= zp;---> {> a_re = p[j][0];> a_im = p[j][1];> p[j][0] = a_re*zp[0] - a_im*zp[1] + p[j-1][0];> p[j][1] = a_re*zp[1] + a_im*zp[0] + p[j-1][1];> }> a_re = p[0][0]*zp[0] - p[0][1]*zp[1];> p[0][1] = p[0][0]*zp[1] + p[0][1]*zp[0];> p[0][0] = a_re;90c104< c->gain = creal(p[order]);---> c->gain = p[order][0];92,93c106,108< c->gain += creal(p[i]);< c->cy[i] = creal(-p[i] / p[order]);---> c->gain += p[i][0];> c->cy[i] = (-p[i][0] * p[order][0] + -p[i][1] * p[order][1]) /> (p[order][0] * p[order][0] + p[order][1] * p[order][1]);100c115< struct FFIIRFilterState* ff_iir_filter_init_state(int order)---> av_cold struct FFIIRFilterState* ff_iir_filter_init_state(int order)151c166< void ff_iir_filter_free_state(struct FFIIRFilterState *state)---> av_cold void ff_iir_filter_free_state(struct FFIIRFilterState *state)156c171< void ff_iir_filter_free_coeffs(struct FFIIRFilterCoeffs *coeffs)---> av_cold void ff_iir_filter_free_coeffs(struct FFIIRFilterCoeffs *coeffs)diff -r mplayer-export-arch/libavcodec/indeo3.c mplayer-export-svn/libavcodec/indeo3.c109a110> av_freep(&s->buf);145,147c146,148< av_free(s->buf);< av_free(s->ModPred);< av_free(s->corrector_type);---> av_freep(&s->buf);> av_freep(&s->ModPred);> av_freep(&s->corrector_type);978c979< static int iv_decode_frame(Indeo3DecodeContext *s,---> static int iv_decode_frame(AVCodecContext *avctx,980a982> Indeo3DecodeContext *s = avctx->priv_data;997c999< if(avcodec_check_dimensions(NULL, image_width, image_height))---> if(avcodec_check_dimensions(avctx, image_width, image_height))998a1001,1011> if (image_width != avctx->width || image_height != avctx->height) {> int ret;> avcodec_set_dimensions(avctx, image_width, image_height);> s->width = avctx->width;> s->height = avctx->height;> ret = iv_alloc_frames(s);> if (ret < 0) {> s->width = s->height = 0;> return ret;> }> }1073c1086< if (iv_decode_frame(s, buf, buf_size) < 0)---> if (iv_decode_frame(avctx, buf, buf_size) < 0)Only in mplayer-export-arch/libavcodec: libamr.cdiff -r mplayer-export-arch/libavcodec/libtheoraenc.c mplayer-export-svn/libavcodec/libtheoraenc.c50c50< char* message = NULL;---> const char* message = NULL;152a153,157> /* Clear up theora_comment struct before we reset the packet */> theora_comment_clear( &t_comment );> /* And despite documentation to the contrary, theora_comment_clear> * does not release the packet */> ogg_packet_clear(&o_packet);160,162d164< /* Clear up theora_comment struct */< theora_comment_clear( &t_comment );< 251a254,257> av_freep(&avc_context->coded_frame);> av_freep(&avc_context->extradata);> avc_context->extradata_size = 0;> Only in mplayer-export-svn/libavcodec: psymodel.cOnly in mplayer-export-svn/libavcodec: psymodel.hdiff -r mplayer-export-arch/libavcodec/qpeg.c mplayer-export-svn/libavcodec/qpeg.c291a292,295> if (!avctx->palctrl) {> av_log(avctx, AV_LOG_FATAL, "Missing required palette via palctrl\n");> return -1;> }diff -r mplayer-export-arch/libavcodec/qtrleenc.c mplayer-export-svn/libavcodec/qtrleenc.c76a77,79> case PIX_FMT_ARGB:> s->pixel_size = 4;> break;328c331< .pix_fmts = (enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_NONE},---> .pix_fmts = (enum PixelFormat[]){PIX_FMT_RGB24, PIX_FMT_ARGB, PIX_FMT_NONE},diff -r mplayer-export-arch/libavcodec/vorbis.c mplayer-export-svn/libavcodec/vorbis.c47a48,50> // the two bits[p] > 32 checks should be redundant, all calling code should> // already ensure that, but since it allows overwriting the stack it seems> // reasonable to check redundantly.65a69> if (bits[p] > 32) return 1;81a86> if (bits[p] > 32) return 1;diff -r mplayer-export-arch/libavcodec/vorbis_dec.c mplayer-export-svn/libavcodec/vorbis_dec.c295c295< for(;current_entry<used_entries;++current_length) {---> for(;current_entry<used_entries && current_length <= 32;++current_length) {diff -r mplayer-export-arch/libavcodec/vp3.c mplayer-export-svn/libavcodec/vp3.c519a520,521> *> * The filter_limit_values may not be larger than 127.525a528> int value;532d534< bounding_values[-x - filter_limit] = -filter_limit + x;535d536< bounding_values[x + filter_limit] = filter_limit - x;536a538,543> for (x = value = filter_limit; x < 128 && value; x++, value--) {> bounding_values[ x] = value;> bounding_values[-x] = -value;> }> if (value)> bounding_values[128] = value;1784c1791< init_vlc(&s->dc_vlc[i], 5, 32,---> if (init_vlc(&s->dc_vlc[i], 5, 32,1786c1793,1794< &s->huffman_table[i][0][0], 4, 2, 0);---> &s->huffman_table[i][0][0], 4, 2, 0) < 0)> goto vlc_fail;1789c1797< init_vlc(&s->ac_vlc_1[i], 5, 32,---> if (init_vlc(&s->ac_vlc_1[i], 5, 32,1791c1799,1800< &s->huffman_table[i+16][0][0], 4, 2, 0);---> &s->huffman_table[i+16][0][0], 4, 2, 0) < 0)> goto vlc_fail;1794c1803< init_vlc(&s->ac_vlc_2[i], 5, 32,---> if (init_vlc(&s->ac_vlc_2[i], 5, 32,1796c1805,1806< &s->huffman_table[i+16*2][0][0], 4, 2, 0);---> &s->huffman_table[i+16*2][0][0], 4, 2, 0) < 0)> goto vlc_fail;1799c1809< init_vlc(&s->ac_vlc_3[i], 5, 32,---> if (init_vlc(&s->ac_vlc_3[i], 5, 32,1801c1811,1812< &s->huffman_table[i+16*3][0][0], 4, 2, 0);---> &s->huffman_table[i+16*3][0][0], 4, 2, 0) < 0)> goto vlc_fail;1804c1815< init_vlc(&s->ac_vlc_4[i], 5, 32,---> if (init_vlc(&s->ac_vlc_4[i], 5, 32,1806c1817,1818< &s->huffman_table[i+16*4][0][0], 4, 2, 0);---> &s->huffman_table[i+16*4][0][0], 4, 2, 0) < 0)> goto vlc_fail;1839a1852,1855> > vlc_fail:> av_log(avctx, AV_LOG_FATAL, "Invalid huffman table\n");> return -1;2167c2183< for (i = 0; i < 64; i++)---> for (i = 0; i < 64; i++) {2168a2185,2189> if (s->filter_limit_values[i] > 127) {> av_log(avctx, AV_LOG_ERROR, "filter limit value too large (%i > 127), clamping\n", s->filter_limit_values[i]);> s->filter_limit_values[i] = 127;> }> }2325,2326c2346< vp3_decode_init(avctx);< return 0;---> return vp3_decode_init(avctx);diff -r mplayer-export-arch/libavcodec/vp56.h mplayer-export-svn/libavcodec/vp56.h52a53> const uint8_t *end;187a189> c->end = buf + buf_size;208c210< if (--c->bits == 0) {---> if (--c->bits == 0 && c->buffer < c->end) {231c233< if (--c->bits == 0) {---> if (--c->bits == 0 && c->buffer < c->end) {diff -r mplayer-export-arch/libavcodec/vp6.c mplayer-export-svn/libavcodec/vp6.c374a375,376> if (get_bits_count(&s->gb) >= s->gb.size_in_bits)> return;diff -r mplayer-export-arch/libavformat/Makefile mplayer-export-svn/libavformat/Makefile23d22< OBJS-$(CONFIG_ASF_STREAM_MUXER) += asfenc.o asf.o riff.o81d79< OBJS-$(CONFIG_IPOD_MUXER) += movenc.o riff.o isom.o avc.o86d83< OBJS-$(CONFIG_MATROSKA_AUDIO_MUXER) += matroskaenc.o matroska.o riff.o isom.o avc.o flacenc.o101d97< OBJS-$(CONFIG_MP4_MUXER) += movenc.o riff.o isom.o avc.o113d108< OBJS-$(CONFIG_MPEGTSRAW_DEMUXER) += mpegts.o122d116< OBJS-$(CONFIG_MXF_D10_MUXER) += mxfenc.o mxf.o audiointerleave.o178d171< OBJS-$(CONFIG_PSP_MUXER) += movenc.o riff.o isom.o avc.o212,213d204< OBJS-$(CONFIG_TG2_MUXER) += movenc.o riff.o isom.o avc.o< OBJS-$(CONFIG_TGP_MUXER) += movenc.o riff.o isom.o avc.odiff -r mplayer-export-arch/libavformat/asfdec.c mplayer-export-svn/libavformat/asfdec.c636c636< if(packet_length >= (1U<<29)){---> if(!packet_length || packet_length >= (1U<<29)){diff -r mplayer-export-arch/libavformat/flvdec.c mplayer-export-svn/libavformat/flvdec.c26a27> #include "libavutil/avstring.h"221c222,223< if(!strcmp(key, "stereo") && acodec) acodec->channels = num_val > 0 ? 2 : 1;---> av_strlcpy(str_val, num_val > 0 ? "true" : "false", sizeof(str_val));> av_metadata_set(&s->metadata, key, str_val);222a225,226> snprintf(str_val, sizeof(str_val), "%.f", num_val);> av_metadata_set(&s->metadata, key, str_val);224,225d227< // else if(!strcmp(key, "width") && vcodec && num_val > 0) vcodec->width = num_val;< // else if(!strcmp(key, "height") && vcodec && num_val > 0) vcodec->height = num_val;228,250c230,231< else if(!strcmp(key, "audiocodecid") && acodec && 0 <= (int)num_val)< flv_set_audio_codec(s, astream, (int)num_val << FLV_AUDIO_CODECID_OFFSET);< else if(!strcmp(key, "videocodecid") && vcodec && 0 <= (int)num_val)< flv_set_video_codec(s, vstream, (int)num_val);< else if(!strcmp(key, "audiosamplesize") && acodec && 0 < (int)num_val) {< acodec->bits_per_coded_sample = num_val;< //we may have to rewrite a previously read codecid because FLV only marks PCM endianness.< if(num_val == 8 && (acodec->codec_id == CODEC_ID_PCM_S16BE || acodec->codec_id == CODEC_ID_PCM_S16LE))< acodec->codec_id = CODEC_ID_PCM_S8;< }< else if(!strcmp(key, "audiosamplerate") && acodec && num_val >= 0) {< //some tools, like FLVTool2, write consistently approximate metadata sample rates< if (!acodec->sample_rate) {< switch((int)num_val) {< case 44000: acodec->sample_rate = 44100 ; break;< case 22000: acodec->sample_rate = 22050 ; break;< case 11000: acodec->sample_rate = 11025 ; break;< case 5000 : acodec->sample_rate = 5512 ; break;< default : acodec->sample_rate = num_val;< }< }< }< }---> } else if (amf_type == AMF_DATA_TYPE_STRING)> av_metadata_set(&s->metadata, key, str_val);378c359< if (type == FLV_TAG_TYPE_META && size > 13+1+4 && 0)---> if (type == FLV_TAG_TYPE_META && size > 13+1+4)diff -r mplayer-export-arch/libavformat/os_support.h mplayer-export-svn/libavformat/os_support.h32c32< #ifdef __MINGW32__---> #if defined(__MINGW32__) && !defined(__MINGW32CE__)diff -r mplayer-export-arch/libavformat/soxdec.c mplayer-export-svn/libavformat/soxdec.c114a115,116> st->codec->block_align = st->codec->bits_per_coded_sample *> st->codec->channels / 8;121c123< #define MAX_SIZE 4096---> #define SOX_SAMPLES 1024126c128< int ret;---> int ret, size;131c133,134< ret = av_get_packet(s->pb, pkt, MAX_SIZE);---> size = SOX_SAMPLES*s->streams[0]->codec->block_align;> ret = av_get_packet(s->pb, pkt, size);diff -r mplayer-export-arch/libavformat/tcp.c mplayer-export-svn/libavformat/tcp.c133c133< return AVERROR(errno);---> return AVERROR(ff_neterrno());163c163< return AVERROR(errno);---> return AVERROR(ff_neterrno());diff -r mplayer-export-arch/libavformat/utils.c mplayer-export-svn/libavformat/utils.c501a502,503> if (ap && ap->prealloced_context)> av_free(*ic_ptr);diff -r mplayer-export-arch/libavutil/Makefile mplayer-export-svn/libavutil/Makefile40c40< sha1.o \---> sha.o \44c44< TESTPROGS = adler32 aes base64 crc des lls md5 pca sha1 softfloat tree---> TESTPROGS = adler32 aes base64 crc des lls md5 pca sha softfloat treediff -r mplayer-export-arch/libavutil/internal.h mplayer-export-svn/libavutil/internal.h261,277d260< #if defined(__ICC) || defined(__SUNPRO_C)< #define DECLARE_ALIGNED(n,t,v) t v __attribute__ ((aligned (n)))< #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v< #elif defined(__GNUC__)< #define DECLARE_ALIGNED(n,t,v) t v __attribute__ ((aligned (n)))< #define DECLARE_ASM_CONST(n,t,v) static const t v attribute_used __attribute__ ((aligned (n)))< #elif defined(_MSC_VER)< #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v< #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v< #elif HAVE_INLINE_ASM< #error The asm code needs alignment, but we do not know how to do it for this compiler.< #else< #define DECLARE_ALIGNED(n,t,v) t v< #define DECLARE_ASM_CONST(n,t,v) static const t v< #endif< < 284a268,274> #if !HAVE_LOG2> static av_always_inline av_const double log2(double x)> {> return log(x) * 1.44269504088896340736;> }> #endif /* HAVE_LOG2 */> diff -r mplayer-export-arch/libavutil/log.h mplayer-export-svn/libavutil/log.h32,33c32< typedef struct AVCLASS AVClass;< struct AVCLASS {---> typedef struct {52c51< };---> } AVClass;diff -r mplayer-export-arch/libavutil/mem.h mplayer-export-svn/libavutil/mem.h30a31,45> #if defined(__ICC) || defined(__SUNPRO_C)> #define DECLARE_ALIGNED(n,t,v) t v __attribute__ ((aligned (n)))> #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v> #elif defined(__GNUC__)> #define DECLARE_ALIGNED(n,t,v) t v __attribute__ ((aligned (n)))> #define DECLARE_ASM_CONST(n,t,v) static const t v attribute_used __attribute__ ((aligned (n)))> #elif defined(_MSC_VER)> #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v> #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v> #else> #define DECLARE_ALIGNED(n,t,v) t v> #define DECLARE_ASM_CONST(n,t,v) static const t v> #endif> > Only in mplayer-export-svn/libavutil: sha.cOnly in mplayer-export-svn/libavutil: sha.hOnly in mplayer-export-arch/libavutil: sha1.cdiff -r mplayer-export-arch/libavutil/sha1.h mplayer-export-svn/libavutil/sha1.h29a30,35> /**> * Initializes SHA-1 hashing.> *> * @param context pointer to the function context (of size av_sha_size)> * @deprecated use av_sha_init() instead> */30a37,45> > /**> * Updates hash value.> *> * @param context hash function context> * @param data input data to update hash with> * @param len input data length> * @deprecated use av_sha_update() instead> */31a47,54> > /**> * Finishes hashing and output digest value.> *> * @param context hash function context> * @param digest buffer where output digest value is stored> * @deprecated use av_sha_final() instead> */