History

Merge remote-tracking branch 'qatar/master'

* qatar/master: (25 commits) Replace custom DEBUG preprocessor trickery by the standard one. vorbis: Remove non-compiling debug statement. vorbis: Remove pointless DEBUG #ifdef around debug output macros. cook: Remove non-compiling debug output. Remove pointless #ifdefs around function declarations in a header. Replace #ifdef + av_log() combinations by av_dlog(). Replace custom debug output functions by av_dlog(). cook: Remove unused debug functions. Remove stray extra arguments from av_dlog() invocations. targa: fix big-endian build v4l2: remove one forgotten use of AVFormatParameters.pix_fmt. vfwcap: add a framerate private option. v4l2: add a framerate private option. libdc1394: add a framerate private option. fbdev: add a framerate private option. bktr: add a framerate private option. oma: check avio_read() return value nutdec: remove unused variable Remove unused variables swscale: allocate larger buffer to handle altivec overreads. ... Conflicts: ffmpeg.c libavcodec/dca.c libavcodec/dirac.c libavcodec/error_resilience.c libavcodec/h264.c libavcodec/mpeg12.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/pthread.c libavcodec/rv10.c libavcodec/s302m.c libavcodec/shorten.c libavcodec/truemotion2.c libavcodec/utils.c libavdevice/dv1394.c libavdevice/fbdev.c libavdevice/libdc1394.c libavdevice/v4l2.c libavformat/4xm.c libavformat/apetag.c libavformat/asfdec.c libavformat/avidec.c libavformat/mmf.c libavformat/mpeg.c libavformat/mpegenc.c libavformat/mpegts.c libavformat/oggdec.c libavformat/oggparseogm.c libavformat/rl2.c libavformat/rmdec.c libavformat/rpl.c libavformat/rtpdec_latm.c libavformat/sauce.c libavformat/sol.c libswscale/utils.c tests/ref/vsynth1/error tests/ref/vsynth2/error

Michael Niedermayer committed 15 years ago

Commit 99eb31e2 parents 9034001 f190f6770 files · +1031 −897Browse files

Unified · Split

70 files
  1. configure +11 −1
  2. ffmpeg.c +2 −3
  3. ffserver.c +2 −2
  4. libavcodec/aaccoder.c +3 −6
  5. libavcodec/aacenc.c +29 −3
  6. libavcodec/aacenc.h +6 −0
  7. libavcodec/cook.c +2 −36
  8. libavcodec/dca.c +2 −4
  9. libavcodec/dirac.c +2 −2
  10. libavcodec/error_resilience.c +38 −7
  11. libavcodec/h263dec.c +3 −0
  12. libavcodec/h264.c +142 −10
  13. libavcodec/indeo5.c +1 −1
  14. libavcodec/interplayvideo.c +8 −16
  15. libavcodec/ituh263dec.c +3 −3
  16. libavcodec/ivi_common.c +3 −3
  17. libavcodec/ivi_common.h +0 −4
  18. libavcodec/mpeg12.c +5 −6
  19. libavcodec/mpeg12enc.c +1 −2
  20. libavcodec/mpeg4videodec.c +7 −12
  21. libavcodec/mpegvideo.c +5 −3
  22. libavcodec/mpegvideo.h +1 −1
  23. libavcodec/mpegvideo_enc.c +1 −1
  24. libavcodec/mpegvideo_parser.c +1 −2
  25. libavcodec/msmpeg4.c +1 −3
  26. libavcodec/pngdec.c +6 −7
  27. libavcodec/pthread.c +1 −1
  28. libavcodec/rv10.c +2 −2
  29. libavcodec/s302m.c +1 −2
  30. libavcodec/shorten.c +1 −2
  31. libavcodec/svq1dec.c +11 −23
  32. libavcodec/targa.c +4 −3
  33. libavcodec/truemotion2.c +0 −13
  34. libavcodec/tscc.c +0 −3
  35. libavcodec/utils.c +1 −1
  36. libavcodec/vorbis.c +3 −6
  37. libavcodec/vorbisdec.c +106 −110
  38. libavcodec/vqavideo.c +6 −14
  39. libavcodec/x86/h264_idct_10bit.asm +84 −94
  40. libavcodec/x86/h264_intrapred.asm +0 −6
  41. libavcodec/x86/h264_intrapred_init.c +0 −8
  42. libavdevice/bktr.c +13 −11
  43. libavdevice/dv1394.c +2 −9
  44. libavdevice/fbdev.c +36 −12
  45. libavdevice/libdc1394.c +257 −189
  46. libavdevice/v4l2.c +20 −12
  47. libavdevice/vfwcap.c +11 −9
  48. libavformat/4xm.c +2 −2
  49. libavformat/ape.c +1 −3
  50. libavformat/apetag.c +2 −4
  51. libavformat/asfdec.c +8 −11
  52. libavformat/gif.c +0 −4
  53. libavformat/ipmovie.c +46 −58
  54. libavformat/mmf.c +2 −2
  55. libavformat/mpeg.c +3 −4
  56. libavformat/mpegenc.c +2 −4
  57. libavformat/mpegts.c +2 −4
  58. libavformat/nutdec.c +1 −3
  59. libavformat/oggdec.c +1 −6
  60. libavformat/oggparseogm.c +1 −3
  61. libavformat/oma.c +2 −0
  62. libavformat/rl2.c +2 −4
  63. libavformat/rmdec.c +2 −2
  64. libavformat/rpl.c +2 −2
  65. libavformat/rtpdec_latm.c +2 −3
  66. libavformat/rtsp.c +0 −3
  67. libavformat/sauce.c +2 −2
  68. libavformat/sol.c +1 −2
  69. tests/fate/h264.mak +102 −102
  70. tests/regression-funcs.sh +1 −1
configure+11−1
@@ -1077,6 +1077,8 @@ HAVE_LIST=" · 1076 unmodified lines
10771077 isatty
10781078 kbhit
10791079 ldbrx
1080+ libdc1394_1
1081+ libdc1394_2
10801082 llrint
10811083 llrintf
10821084 local_aligned_16
@@ -2914,7 +2916,6 @@ check_mathfunc truncf · 1831 unmodified lines
29142916 enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lavifil32
29152917 enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0
29162918 enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
2917−enabled libdc1394 && require_pkg_config libdc1394-2 dc1394/dc1394.h dc1394_new
29182919 enabled libdirac && require_pkg_config dirac \
29192920 "libdirac_decoder/dirac_parser.h libdirac_encoder/dirac_encoder.h" \
29202921 "dirac_decoder_init dirac_encoder_init"
@@ -2946,6 +2947,15 @@ enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs · 25 unmodified lines
29462947 enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
29472948 enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
29482949
2950+# libdc1394 check
2951+if enabled libdc1394; then
2952+ { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
2953+ enable libdc1394_2; } ||
2954+ { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
2955+ enable libdc1394_1; } ||
2956+ die "ERROR: No version of libdc1394 found "
2957+fi
2958+
29492959 SDL_CONFIG="${cross_prefix}sdl-config"
29502960 if check_pkg_config sdl SDL_version.h SDL_Linked_Version; then
29512961 check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
ffmpeg.c+2−3
@@ -1242,7 +1242,7 @@ static void do_video_out(AVFormatContext *s, · 1241 unmodified lines
12421242 }
12431243 }
12441244 sws_scale(ost->img_resample_ctx, formatted_picture->data, formatted_picture->linesize,
1245− 0, ost->resample_height, ost->resample_frame.data, ost->resample_frame.linesize);
1245+ 0, ost->resample_height, final_picture->data, final_picture->linesize);
12461246 }
12471247 #endif
12481248
@@ -3723,7 +3723,6 @@ static void new_audio_stream(AVFormatContext *oc, int file_idx) · 2474 unmodified lines
37233723 static void new_data_stream(AVFormatContext *oc, int file_idx)
37243724 {
37253725 AVStream *st;
3726− AVOutputStream *ost av_unused;
37273726 AVCodec *codec=NULL;
37283727 AVCodecContext *data_enc;
37293728
@@ -3732,7 +3731,7 @@ static void new_data_stream(AVFormatContext *oc, int file_idx) · 2 unmodified lines
37323731 fprintf(stderr, "Could not alloc stream\n");
37333732 ffmpeg_exit(1);
37343733 }
3735− ost = new_output_stream(oc, file_idx);
3734+ new_output_stream(oc, file_idx);
37363735 data_enc = st->codec;
37373736 output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1);
37383737 if (!data_stream_copy) {
ffserver.c+2−2
@@ -1760,7 +1760,7 @@ static int http_parse_request(HTTPContext *c) · 1759 unmodified lines
17601760 }
17611761 }
17621762
1763−#ifdef DEBUG_WMP
1763+#ifdef DEBUG
17641764 http_log("\nGot request:\n%s\n", c->buffer);
17651765 #endif
17661766
@@ -1790,7 +1790,7 @@ static int http_parse_request(HTTPContext *c) · 23 unmodified lines
17901790 return 0;
17911791 }
17921792
1793−#ifdef DEBUG_WMP
1793+#ifdef DEBUG
17941794 if (strcmp(stream->filename + strlen(stream->filename) - 4, ".asf") == 0)
17951795 http_log("\nGot request:\n%s\n", c->buffer);
17961796 #endif
libavcodec/aaccoder.c+3−6
@@ -312,7 +312,7 @@ static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce · 311 unmodified lines
312312 int win, int group_len, const float lambda)
313313 {
314314 BandCodingPath path[120][12];
315− int w, swb, cb, start, start2, size;
315+ int w, swb, cb, start, size;
316316 int i, j;
317317 const int max_sfb = sce->ics.max_sfb;
318318 const int run_bits = sce->ics.num_windows == 1 ? 5 : 3;
@@ -330,7 +330,6 @@ static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce · 11 unmodified lines
330330 path[0][cb].run = 0;
331331 }
332332 for (swb = 0; swb < max_sfb; swb++) {
333− start2 = start;
334333 size = sce->ics.swb_sizes[swb];
335334 if (sce->zeroes[win*16 + swb]) {
336335 for (cb = 0; cb < 12; cb++) {
@@ -414,7 +413,7 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce, · 77 unmodified lines
414413 int win, int group_len, const float lambda)
415414 {
416415 BandCodingPath path[120][12];
417− int w, swb, cb, start, start2, size;
416+ int w, swb, cb, start, size;
418417 int i, j;
419418 const int max_sfb = sce->ics.max_sfb;
420419 const int run_bits = sce->ics.num_windows == 1 ? 5 : 3;
@@ -432,7 +431,6 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce, · 11 unmodified lines
432431 path[0][cb].run = 0;
433432 }
434433 for (swb = 0; swb < max_sfb; swb++) {
435− start2 = start;
436434 size = sce->ics.swb_sizes[swb];
437435 if (sce->zeroes[win*16 + swb]) {
438436 for (cb = 0; cb < 12; cb++) {
@@ -1007,12 +1005,11 @@ static void search_for_quantizers_fast(AVCodecContext *avctx, AACEncContext *s, · 568 unmodified lines
10071005 SingleChannelElement *sce,
10081006 const float lambda)
10091007 {
1010− int start = 0, i, w, w2, g;
1008+ int i, w, w2, g;
10111009 int minq = 255;
10121010
10131011 memset(sce->sf_idx, 0, sizeof(sce->sf_idx));
10141012 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
1015− start = w*128;
10161013 for (g = 0; g < sce->ics.num_swb; g++) {
10171014 for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) {
10181015 FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g];
libavcodec/aacenc.c+29−3
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 * add temporal noise shaping
3131 ***********************************/
3232
33+#include "libavutil/opt.h"
3334 #include "avcodec.h"
3435 #include "put_bits.h"
3536 #include "dsputil.h"
@@ -489,7 +490,7 @@ static int aac_encode_frame(AVCodecContext *avctx, · 453 unmodified lines
489490 AACEncContext *s = avctx->priv_data;
490491 int16_t *samples = s->samples, *samples2, *la;
491492 ChannelElement *cpe;
492− int i, ch, w, chans, tag, start_ch;
493+ int i, ch, w, g, chans, tag, start_ch;
493494 const uint8_t *chan_map = aac_chan_configs[avctx->channels-1];
494495 int chan_el_counter[4];
495496 FFPsyWindowInfo windows[AAC_MAX_CHANNELS];
@@ -587,8 +588,16 @@ static int aac_encode_frame(AVCodecContext *avctx, · 91 unmodified lines
587588 }
588589 }
589590 s->cur_channel = start_ch;
590− if (cpe->common_window && s->coder->search_for_ms)
591− s->coder->search_for_ms(s, cpe, s->lambda);
591+ if (s->options.stereo_mode && cpe->common_window) {
592+ if (s->options.stereo_mode > 0) {
593+ IndividualChannelStream *ics = &cpe->ch[0].ics;
594+ for (w = 0; w < ics->num_windows; w += ics->group_len[w])
595+ for (g = 0; g < ics->num_swb; g++)
596+ cpe->ms_mask[w*16+g] = 1;
597+ } else if (s->coder->search_for_ms) {
598+ s->coder->search_for_ms(s, cpe, s->lambda);
599+ }
600+ }
592601 adjust_frame_information(s, cpe, chans);
593602 if (chans == 2) {
594603 put_bits(&s->pb, 1, cpe->common_window);
@@ -645,6 +654,22 @@ static av_cold int aac_encode_end(AVCodecContext *avctx) · 50 unmodified lines
645654 return 0;
646655 }
647656
657+#define AACENC_FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM
658+static const AVOption aacenc_options[] = {
659+ {"stereo_mode", "Stereo coding method", offsetof(AACEncContext, options.stereo_mode), FF_OPT_TYPE_INT, {.dbl = 0}, -1, 1, AACENC_FLAGS, "stereo_mode"},
660+ {"auto", "Selected by the Encoder", 0, FF_OPT_TYPE_CONST, {.dbl = -1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
661+ {"ms_off", "Disable Mid/Side coding", 0, FF_OPT_TYPE_CONST, {.dbl = 0 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
662+ {"ms_force", "Force Mid/Side for the whole frame if possible", 0, FF_OPT_TYPE_CONST, {.dbl = 1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"},
663+ {NULL}
664+};
665+
666+static const AVClass aacenc_class = {
667+ "AAC encoder",
668+ av_default_item_name,
669+ aacenc_options,
670+ LIBAVUTIL_VERSION_INT,
671+};
672+
648673 AVCodec ff_aac_encoder = {
649674 "aac",
650675 AVMEDIA_TYPE_AUDIO,
@@ -656,4 +681,5 @@ AVCodec ff_aac_encoder = { · 5 unmodified lines
656681 .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY | CODEC_CAP_EXPERIMENTAL,
657682 .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
658683 .long_name = NULL_IF_CONFIG_SMALL("Advanced Audio Coding"),
684+ .priv_class = &aacenc_class,
659685 };
libavcodec/aacenc.h+6−0
@@ -30,6 +30,10 @@ · 29 unmodified lines
3030
3131 #include "psymodel.h"
3232
33+typedef struct AACEncOptions {
34+ int stereo_mode;
35+} AACEncOptions;
36+
3337 struct AACEncContext;
3438
3539 typedef struct AACCoefficientsEncoder {
@@ -48,6 +52,8 @@ extern AACCoefficientsEncoder ff_aac_coders[]; · 12 unmodified lines
4852 * AAC encoder context
4953 */
5054 typedef struct AACEncContext {
55+ AVClass *av_class;
56+ AACEncOptions options; ///< encoding options
5157 PutBitContext pb;
5258 FFTContext mdct1024; ///< long (1024 samples) frame transform context
5359 FFTContext mdct128; ///< short (128 samples) frame transform context
libavcodec/cook.c+2−36
@@ -66,7 +66,6 @@ · 65 unmodified lines
6666
6767 #define SUBBAND_SIZE 20
6868 #define MAX_SUBPACKETS 5
69−//#define COOKDEBUG
7069
7170 typedef struct {
7271 int *now;
@@ -166,38 +165,6 @@ typedef struct cook { · 93 unmodified lines
166165 static float pow2tab[127];
167166 static float rootpow2tab[127];
168167
169−/* debug functions */
170−
171−#ifdef COOKDEBUG
172−static void dump_float_table(float* table, int size, int delimiter) {
173− int i=0;
174− av_log(NULL,AV_LOG_ERROR,"\n[%d]: ",i);
175− for (i=0 ; i<size ; i++) {
176− av_log(NULL, AV_LOG_ERROR, "%5.1f, ", table[i]);
177− if ((i+1)%delimiter == 0) av_log(NULL,AV_LOG_ERROR,"\n[%d]: ",i+1);
178− }
179−}
180−
181−static void dump_int_table(int* table, int size, int delimiter) {
182− int i=0;
183− av_log(NULL,AV_LOG_ERROR,"\n[%d]: ",i);
184− for (i=0 ; i<size ; i++) {
185− av_log(NULL, AV_LOG_ERROR, "%d, ", table[i]);
186− if ((i+1)%delimiter == 0) av_log(NULL,AV_LOG_ERROR,"\n[%d]: ",i+1);
187− }
188−}
189−
190−static void dump_short_table(short* table, int size, int delimiter) {
191− int i=0;
192− av_log(NULL,AV_LOG_ERROR,"\n[%d]: ",i);
193− for (i=0 ; i<size ; i++) {
194− av_log(NULL, AV_LOG_ERROR, "%d, ", table[i]);
195− if ((i+1)%delimiter == 0) av_log(NULL,AV_LOG_ERROR,"\n[%d]: ",i+1);
196− }
197−}
198−
199−#endif
200−
201168 /*************** init functions ***************/
202169
203170 /* table generator */
@@ -1037,7 +1004,7 @@ static int cook_decode_frame(AVCodecContext *avctx, · 833 unmodified lines
10371004 return avctx->block_align;
10381005 }
10391006
1040−#ifdef COOKDEBUG
1007+#ifdef DEBUG
10411008 static void dump_cook_context(COOKContext *q)
10421009 {
10431010 //int i=0;
@@ -1055,7 +1022,6 @@ static void dump_cook_context(COOKContext *q) · 11 unmodified lines
10551022 PRINT("samples_per_channel",q->subpacket[0].samples_per_channel);
10561023 PRINT("samples_per_frame",q->subpacket[0].samples_per_frame);
10571024 PRINT("subbands",q->subpacket[0].subbands);
1058− PRINT("random_state",q->random_state);
10591025 PRINT("js_subband_start",q->subpacket[0].js_subband_start);
10601026 PRINT("log2_numvector_size",q->subpacket[0].log2_numvector_size);
10611027 PRINT("numvector_size",q->subpacket[0].numvector_size);
@@ -1280,7 +1246,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) · 218 unmodified lines
12801246 else
12811247 avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
12821248
1283−#ifdef COOKDEBUG
1249+#ifdef DEBUG
12841250 dump_cook_context(q);
12851251 #endif
12861252 return 0;
libavcodec/dca.c+2−4
@@ -1535,8 +1535,6 @@ static void dca_exss_parse_header(DCAContext *s) · 1534 unmodified lines
15351535 {
15361536 int ss_index;
15371537 int blownup;
1538− int header_size av_unused;
1539− int hd_size av_unused;
15401538 int num_audiop = 1;
15411539 int num_assets = 1;
15421540 int active_ss_mask[8];
@@ -1549,8 +1547,8 @@ static void dca_exss_parse_header(DCAContext *s) · 6 unmodified lines
15491547 ss_index = get_bits(&s->gb, 2);
15501548
15511549 blownup = get_bits1(&s->gb);
1552− header_size = get_bits(&s->gb, 8 + 4 * blownup) + 1;
1553− hd_size = get_bits_long(&s->gb, 16 + 4 * blownup) + 1;
1550+ skip_bits(&s->gb, 8 + 4 * blownup); // header_size
1551+ skip_bits(&s->gb, 16 + 4 * blownup); // hd_size
15541552
15551553 s->static_fields = get_bits1(&s->gb);
15561554 if (s->static_fields) {
libavcodec/dirac.c+2−2
@@ -245,11 +245,11 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb, · 244 unmodified lines
245245 int ff_dirac_parse_sequence_header(AVCodecContext *avctx, GetBitContext *gb,
246246 dirac_source_params *source)
247247 {
248− unsigned version_major, version_minor av_unused;
248+ unsigned version_major;
249249 unsigned video_format, picture_coding_mode;
250250
251251 version_major = svq3_get_ue_golomb(gb);
252− version_minor = svq3_get_ue_golomb(gb);
252+ svq3_get_ue_golomb(gb); /* version_minor */
253253 avctx->profile = svq3_get_ue_golomb(gb);
254254 avctx->level = svq3_get_ue_golomb(gb);
255255 video_format = svq3_get_ue_golomb(gb);
libavcodec/error_resilience.c+38−7
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include "mpegvideo.h"
3333 #include "h264.h"
3434 #include "rectangle.h"
35+#include "thread.h"
3536
3637 /*
3738 * H264 redefines mb_intra so it is not mistakely used (its uninitialized in h264)
@@ -436,8 +437,7 @@ int score_sum=0; · 398 unmodified lines
436437 int best_score=256*256*256*64;
437438 int best_pred=0;
438439 const int mot_index= (mb_x + mb_y*mot_stride) * mot_step;
439− int prev_x= s->current_picture.motion_val[0][mot_index][0];
440− int prev_y= s->current_picture.motion_val[0][mot_index][1];
440+ int prev_x, prev_y, prev_ref;
441441
442442 if((mb_x^mb_y^pass)&1) continue;
443443
@@ -535,10 +535,26 @@ skip_mean_and_median: · 91 unmodified lines
535535 /* zero MV */
536536 pred_count++;
537537
538+ if (!fixed[mb_xy] && 0) {
539+ if (s->avctx->codec_id == CODEC_ID_H264) {
540+ // FIXME
541+ } else {
542+ ff_thread_await_progress((AVFrame *) s->last_picture_ptr,
543+ mb_y, 0);
544+ }
545+ prev_x = s->last_picture.motion_val[0][mot_index][0];
546+ prev_y = s->last_picture.motion_val[0][mot_index][1];
547+ prev_ref = s->last_picture.ref_index[0][4*mb_xy];
548+ } else {
549+ prev_x = s->current_picture.motion_val[0][mot_index][0];
550+ prev_y = s->current_picture.motion_val[0][mot_index][1];
551+ prev_ref = s->current_picture.ref_index[0][4*mb_xy];
552+ }
553+
538554 /* last MV */
539− mv_predictor[pred_count][0]= s->current_picture.motion_val[0][mot_index][0];
540− mv_predictor[pred_count][1]= s->current_picture.motion_val[0][mot_index][1];
541− ref [pred_count] = s->current_picture.ref_index[0][4*mb_xy];
555+ mv_predictor[pred_count][0]= prev_x;
556+ mv_predictor[pred_count][1]= prev_y;
557+ ref [pred_count] = prev_ref;
542558 pred_count++;
543559
544560 s->mv_dir = MV_DIR_FORWARD;
@@ -670,6 +686,12 @@ static int is_intra_more_likely(MpegEncContext *s){ · 125 unmodified lines
670686 uint8_t *mb_ptr = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
671687 uint8_t *last_mb_ptr= s->last_picture.data [0] + mb_x*16 + mb_y*16*s->linesize;
672688
689+ if (s->avctx->codec_id == CODEC_ID_H264) {
690+ // FIXME
691+ } else {
692+ ff_thread_await_progress((AVFrame *) s->last_picture_ptr,
693+ mb_y, 0);
694+ }
673695 is_intra_likely += s->dsp.sad[0](NULL, last_mb_ptr, mb_ptr , s->linesize, 16);
674696 // FIXME need await_progress() here
675697 is_intra_likely -= s->dsp.sad[0](NULL, last_mb_ptr, last_mb_ptr+s->linesize*16, s->linesize, 16);
@@ -690,6 +712,7 @@ void ff_er_frame_start(MpegEncContext *s){ · 14 unmodified lines
690712
691713 memset(s->error_status_table, MV_ERROR|AC_ERROR|DC_ERROR|VP_START|AC_END|DC_END|MV_END, s->mb_stride*s->mb_height*sizeof(uint8_t));
692714 s->error_count= 3*s->mb_num;
715+ s->error_occurred = 0;
693716 }
694717
695718 /**
@@ -729,7 +752,10 @@ void ff_er_add_slice(MpegEncContext *s, int startx, int starty, int endx, int en · 33 unmodified lines
729752 s->error_count -= end_i - start_i + 1;
730753 }
731754
732− if(status & (AC_ERROR|DC_ERROR|MV_ERROR)) s->error_count= INT_MAX;
755+ if(status & (AC_ERROR|DC_ERROR|MV_ERROR)) {
756+ s->error_occurred = 1;
757+ s->error_count= INT_MAX;
758+ }
733759
734760 if(mask == ~0x7F){
735761 memset(&s->error_status_table[start_xy], 0, (end_xy - start_xy) * sizeof(uint8_t));
@@ -1009,7 +1035,12 @@ void ff_er_frame_end(MpegEncContext *s){ · 273 unmodified lines
10091035 int time_pp= s->pp_time;
10101036 int time_pb= s->pb_time;
10111037
1012− // FIXME await_progress here
1038+ if (s->avctx->codec_id == CODEC_ID_H264) {
1039+ //FIXME
1040+ } else {
1041+ ff_thread_await_progress((AVFrame *) s->next_picture_ptr,
1042+ mb_y, 0);
1043+ }
10131044 s->mv[0][0][0] = s->next_picture.motion_val[0][xy][0]*time_pb/time_pp;
10141045 s->mv[0][0][1] = s->next_picture.motion_val[0][xy][1]*time_pb/time_pp;
10151046 s->mv[1][0][0] = s->next_picture.motion_val[0][xy][0]*(time_pb - time_pp)/time_pp;
libavcodec/h263dec.c+3−0
@@ -656,8 +656,11 @@ retry: · 655 unmodified lines
656656 if(s->slice_height==0 || s->mb_x!=0 || (s->mb_y%s->slice_height)!=0 || get_bits_count(&s->gb) > s->gb.size_in_bits)
657657 break;
658658 }else{
659+ int prev_x=s->mb_x, prev_y=s->mb_y;
659660 if(ff_h263_resync(s)<0)
660661 break;
662+ if (prev_y * s->mb_width + prev_x < s->mb_y * s->mb_width + s->mb_x)
663+ s->error_occurred = 1;
661664 }
662665
663666 if(s->msmpeg4_version<4 && s->h263_pred)
libavcodec/h264.c+142−10
@@ -246,6 +246,141 @@ static int ff_h264_decode_rbsp_trailing(H264Context *h, const uint8_t *src){ · 245 unmodified lines
246246 return 0;
247247 }
248248
249+static inline int get_lowest_part_list_y(H264Context *h, Picture *pic, int n, int height,
250+ int y_offset, int list){
251+ int raw_my= h->mv_cache[list][ scan8[n] ][1];
252+ int filter_height= (raw_my&3) ? 2 : 0;
253+ int full_my= (raw_my>>2) + y_offset;
254+ int top = full_my - filter_height, bottom = full_my + height + filter_height;
255+
256+ return FFMAX(abs(top), bottom);
257+}
258+
259+static inline void get_lowest_part_y(H264Context *h, int refs[2][48], int n, int height,
260+ int y_offset, int list0, int list1, int *nrefs){
261+ MpegEncContext * const s = &h->s;
262+ int my;
263+
264+ y_offset += 16*(s->mb_y >> MB_FIELD);
265+
266+ if(list0){
267+ int ref_n = h->ref_cache[0][ scan8[n] ];
268+ Picture *ref= &h->ref_list[0][ref_n];
269+
270+ // Error resilience puts the current picture in the ref list.
271+ // Don't try to wait on these as it will cause a deadlock.
272+ // Fields can wait on each other, though.
273+ if(ref->thread_opaque != s->current_picture.thread_opaque ||
274+ (ref->reference&3) != s->picture_structure) {
275+ my = get_lowest_part_list_y(h, ref, n, height, y_offset, 0);
276+ if (refs[0][ref_n] < 0) nrefs[0] += 1;
277+ refs[0][ref_n] = FFMAX(refs[0][ref_n], my);
278+ }
279+ }
280+
281+ if(list1){
282+ int ref_n = h->ref_cache[1][ scan8[n] ];
283+ Picture *ref= &h->ref_list[1][ref_n];
284+
285+ if(ref->thread_opaque != s->current_picture.thread_opaque ||
286+ (ref->reference&3) != s->picture_structure) {
287+ my = get_lowest_part_list_y(h, ref, n, height, y_offset, 1);
288+ if (refs[1][ref_n] < 0) nrefs[1] += 1;
289+ refs[1][ref_n] = FFMAX(refs[1][ref_n], my);
290+ }
291+ }
292+}
293+
294+/**
295+ * Wait until all reference frames are available for MC operations.
296+ *
297+ * @param h the H264 context
298+ */
299+static void await_references(H264Context *h){
300+ MpegEncContext * const s = &h->s;
301+ const int mb_xy= h->mb_xy;
302+ const int mb_type= s->current_picture.mb_type[mb_xy];
303+ int refs[2][48];
304+ int nrefs[2] = {0};
305+ int ref, list;
306+
307+ memset(refs, -1, sizeof(refs));
308+
309+ if(IS_16X16(mb_type)){
310+ get_lowest_part_y(h, refs, 0, 16, 0,
311+ IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
312+ }else if(IS_16X8(mb_type)){
313+ get_lowest_part_y(h, refs, 0, 8, 0,
314+ IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
315+ get_lowest_part_y(h, refs, 8, 8, 8,
316+ IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1), nrefs);
317+ }else if(IS_8X16(mb_type)){
318+ get_lowest_part_y(h, refs, 0, 16, 0,
319+ IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1), nrefs);
320+ get_lowest_part_y(h, refs, 4, 16, 0,
321+ IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1), nrefs);
322+ }else{
323+ int i;
324+
325+ assert(IS_8X8(mb_type));
326+
327+ for(i=0; i<4; i++){
328+ const int sub_mb_type= h->sub_mb_type[i];
329+ const int n= 4*i;
330+ int y_offset= (i&2)<<2;
331+
332+ if(IS_SUB_8X8(sub_mb_type)){
333+ get_lowest_part_y(h, refs, n , 8, y_offset,
334+ IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs);
335+ }else if(IS_SUB_8X4(sub_mb_type)){
336+ get_lowest_part_y(h, refs, n , 4, y_offset,
337+ IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs);
338+ get_lowest_part_y(h, refs, n+2, 4, y_offset+4,
339+ IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs);
340+ }else if(IS_SUB_4X8(sub_mb_type)){
341+ get_lowest_part_y(h, refs, n , 8, y_offset,
342+ IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs);
343+ get_lowest_part_y(h, refs, n+1, 8, y_offset,
344+ IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs);
345+ }else{
346+ int j;
347+ assert(IS_SUB_4X4(sub_mb_type));
348+ for(j=0; j<4; j++){
349+ int sub_y_offset= y_offset + 2*(j&2);
350+ get_lowest_part_y(h, refs, n+j, 4, sub_y_offset,
351+ IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1), nrefs);
352+ }
353+ }
354+ }
355+ }
356+
357+ for(list=h->list_count-1; list>=0; list--){
358+ for(ref=0; ref<48 && nrefs[list]; ref++){
359+ int row = refs[list][ref];
360+ if(row >= 0){
361+ Picture *ref_pic = &h->ref_list[list][ref];
362+ int ref_field = ref_pic->reference - 1;
363+ int ref_field_picture = ref_pic->field_picture;
364+ int pic_height = 16*s->mb_height >> ref_field_picture;
365+
366+ row <<= MB_MBAFF;
367+ nrefs[list]--;
368+
369+ if(!FIELD_PICTURE && ref_field_picture){ // frame referencing two fields
370+ ff_thread_await_progress((AVFrame*)ref_pic, FFMIN((row >> 1) - !(row&1), pic_height-1), 1);
371+ ff_thread_await_progress((AVFrame*)ref_pic, FFMIN((row >> 1) , pic_height-1), 0);
372+ }else if(FIELD_PICTURE && !ref_field_picture){ // field referencing one field of a frame
373+ ff_thread_await_progress((AVFrame*)ref_pic, FFMIN(row*2 + ref_field , pic_height-1), 0);
374+ }else if(FIELD_PICTURE){
375+ ff_thread_await_progress((AVFrame*)ref_pic, FFMIN(row, pic_height-1), ref_field);
376+ }else{
377+ ff_thread_await_progress((AVFrame*)ref_pic, FFMIN(row, pic_height-1), 0);
378+ }
379+ }
380+ }
381+ }
382+}
383+
249384 #if 0
250385 /**
251386 * DCT transforms the 16 dc values.
@@ -315,6 +450,7 @@ static void chroma_dc_dct_c(DCTELEM *block){ · 63 unmodified lines
315450 static void free_tables(H264Context *h, int free_rbsp){
316451 int i;
317452 H264Context *hx;
453+
318454 av_freep(&h->intra4x4_pred_mode);
319455 av_freep(&h->chroma_pred_mode_table);
320456 av_freep(&h->cbp_table);
@@ -611,6 +747,7 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx){ · 290 unmodified lines
611747 return 0;
612748 }
613749
750+
614751 #define IN_RANGE(a, b, size) (((a) >= (b)) && ((a) < ((b)+(size))))
615752 static void copy_picture_range(Picture **to, Picture **from, int count, MpegEncContext *new_base, MpegEncContext *old_base)
616753 {
@@ -711,7 +848,8 @@ static int decode_update_thread_context(AVCodecContext *dst, const AVCodecContex · 94 unmodified lines
711848 copy_fields(h, h1, poc_lsb, redundant_pic_count);
712849
713850 //reference lists
714− copy_fields(h, h1, ref_count, intra_gb);
851+ copy_fields(h, h1, ref_count, list_count);
852+ copy_fields(h, h1, ref_list, intra_gb);
715853 copy_fields(h, h1, short_ref, cabac_init_idc);
716854
717855 copy_picture_range(h->short_ref, h1->short_ref, 32, s, s1);
@@ -738,6 +876,7 @@ int ff_h264_frame_start(H264Context *h){ · 20 unmodified lines
738876 MpegEncContext * const s = &h->s;
739877 int i;
740878 const int pixel_shift = h->pixel_shift;
879+ int thread_count = (s->avctx->active_thread_type & FF_THREAD_SLICE) ? s->avctx->thread_count : 1;
741880
742881 if(MPV_frame_start(s, s->avctx) < 0)
743882 return -1;
@@ -766,7 +905,7 @@ int ff_h264_frame_start(H264Context *h){ · 22 unmodified lines
766905
767906 /* can't be in alloc_tables because linesize isn't known there.
768907 * FIXME: redo bipred weight to not require extra buffer? */
769− for(i = 0; i < s->avctx->thread_count; i++)
908+ for(i = 0; i < thread_count; i++)
770909 if(h->thread_context[i] && !h->thread_context[i]->s.obmc_scratchpad)
771910 h->thread_context[i]->s.obmc_scratchpad = av_malloc(16*2*s->linesize + 8*2*s->uvlinesize);
772911
@@ -2910,12 +3049,6 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){ · 2137 unmodified lines
29103049 int nal_index;
29113050
29123051 h->max_contexts = (HAVE_THREADS && (s->avctx->active_thread_type&FF_THREAD_SLICE)) ? avctx->thread_count : 1;
2913−#if 0
2914− int i;
2915− for(i=0; i<50; i++){
2916− av_log(NULL, AV_LOG_ERROR,"%02X ", buf[i]);
2917− }
2918−#endif
29193052 if(!(s->flags2 & CODEC_FLAG2_CHUNKS)){
29203053 h->current_slice = 0;
29213054 if (!s->first_field)
@@ -3491,8 +3624,7 @@ AVCodec ff_h264_decoder = { · 569 unmodified lines
34913624 ff_h264_decode_end,
34923625 decode_frame,
34933626 /*CODEC_CAP_DRAW_HORIZ_BAND |*/ CODEC_CAP_DR1 | CODEC_CAP_DELAY |
3494− CODEC_CAP_FRAME_THREADS |
3495− CODEC_CAP_SLICE_THREADS,
3627+ CODEC_CAP_SLICE_THREADS | CODEC_CAP_FRAME_THREADS,
34963628 .flush= flush_dpb,
34973629 .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
34983630 .init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy),
libavcodec/indeo5.c+1−1
@@ -629,7 +629,7 @@ static int decode_band(IVI5DecContext *ctx, int plane_num, · 628 unmodified lines
629629 FFSWAP(int16_t, band->rv_map->valtab[idx1], band->rv_map->valtab[idx2]);
630630 }
631631
632−#if IVI_DEBUG
632+#ifdef DEBUG
633633 if (band->checksum_present) {
634634 uint16_t chksum = ivi_calc_band_checksum(band);
635635 if (chksum != band->checksum) {
libavcodec/interplayvideo.c+8−16
@@ -46,14 +46,6 @@ · 45 unmodified lines
4646
4747 #define PALETTE_COUNT 256
4848
49−/* debugging support */
50−#define DEBUG_INTERPLAY 0
51−#if DEBUG_INTERPLAY
52−#define debug_interplay(x,...) av_log(NULL, AV_LOG_DEBUG, x, __VA_ARGS__)
53−#else
54−static inline void debug_interplay(const char *format, ...) { }
55−#endif
56−
5749 typedef struct IpvideoContext {
5850
5951 AVCodecContext *avctx;
@@ -141,7 +133,7 @@ static int ipvideo_decode_block_opcode_0x2(IpvideoContext *s) · 81 unmodified lines
141133 y = 8 + ((B - 56) / 29);
142134 }
143135
144− debug_interplay (" motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
136+ av_dlog(NULL, " motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
145137 return copy_from(s, &s->second_last_frame, x, y);
146138 }
147139
@@ -169,7 +161,7 @@ static int ipvideo_decode_block_opcode_0x3(IpvideoContext *s) · 21 unmodified lines
169161 y = -( 8 + ((B - 56) / 29));
170162 }
171163
172− debug_interplay (" motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
164+ av_dlog(NULL, " motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
173165 return copy_from(s, &s->current_frame, x, y);
174166 }
175167
@@ -192,7 +184,7 @@ static int ipvideo_decode_block_opcode_0x4(IpvideoContext *s) · 16 unmodified lines
192184 x = -8 + BL;
193185 y = -8 + BH;
194186
195− debug_interplay (" motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
187+ av_dlog(NULL, " motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
196188 return copy_from(s, &s->last_frame, x, y);
197189 }
198190
@@ -207,7 +199,7 @@ static int ipvideo_decode_block_opcode_0x5(IpvideoContext *s) · 8 unmodified lines
207199 x = *s->stream_ptr++;
208200 y = *s->stream_ptr++;
209201
210− debug_interplay (" motion bytes = %d, %d\n", x, y);
202+ av_dlog(NULL, " motion bytes = %d, %d\n", x, y);
211203 return copy_from(s, &s->last_frame, x, y);
212204 }
213205
@@ -588,7 +580,7 @@ static int ipvideo_decode_block_opcode_0x6_16(IpvideoContext *s) · 374 unmodified lines
588580 x = *s->stream_ptr++;
589581 y = *s->stream_ptr++;
590582
591− debug_interplay (" motion bytes = %d, %d\n", x, y);
583+ av_dlog(NULL, " motion bytes = %d, %d\n", x, y);
592584 return copy_from(s, &s->second_last_frame, x, y);
593585 }
594586
@@ -965,7 +957,7 @@ static void ipvideo_decode_opcodes(IpvideoContext *s) · 370 unmodified lines
965957 static int frame = 0;
966958 GetBitContext gb;
967959
968− debug_interplay("------------------ frame %d\n", frame);
960+ av_dlog(NULL, "------------------ frame %d\n", frame);
969961 frame++;
970962
971963 if (!s->is_16bpp) {
@@ -991,8 +983,8 @@ static void ipvideo_decode_opcodes(IpvideoContext *s) · 19 unmodified lines
991983 for (x = 0; x < s->avctx->width; x += 8) {
992984 opcode = get_bits(&gb, 4);
993985
994− debug_interplay(" block @ (%3d, %3d): encoding 0x%X, data ptr @ %p\n",
995− x, y, opcode, s->stream_ptr);
986+ av_dlog(NULL, " block @ (%3d, %3d): encoding 0x%X, data ptr @ %p\n",
987+ x, y, opcode, s->stream_ptr);
996988
997989 if (!s->is_16bpp) {
998990 s->pixel_ptr = s->current_frame.data[0] + x
libavcodec/ituh263dec.c+3−3
@@ -152,7 +152,7 @@ int ff_h263_decode_mba(MpegEncContext *s) · 151 unmodified lines
152152 */
153153 static int h263_decode_gob_header(MpegEncContext *s)
154154 {
155− unsigned int val, gfid, gob_number;
155+ unsigned int val, gob_number;
156156 int left;
157157
158158 /* Check for GOB Start Code */
@@ -183,12 +183,12 @@ static int h263_decode_gob_header(MpegEncContext *s) · 24 unmodified lines
183183 s->qscale = get_bits(&s->gb, 5); /* SQUANT */
184184 if(get_bits1(&s->gb)==0)
185185 return -1;
186− gfid = get_bits(&s->gb, 2); /* GFID */
186+ skip_bits(&s->gb, 2); /* GFID */
187187 }else{
188188 gob_number = get_bits(&s->gb, 5); /* GN */
189189 s->mb_x= 0;
190190 s->mb_y= s->gob_index* gob_number;
191− gfid = get_bits(&s->gb, 2); /* GFID */
191+ skip_bits(&s->gb, 2); /* GFID */
192192 s->qscale = get_bits(&s->gb, 5); /* GQUANT */
193193 }
194194
libavcodec/ivi_common.c+3−3
@@ -418,8 +418,8 @@ int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile) · 417 unmodified lines
418418 break;
419419 pos = band->scan[scan_pos];
420420
421− if (IVI_DEBUG && !val)
422− av_log(NULL, AV_LOG_ERROR, "Val = 0 encountered!\n");
421+ if (!val)
422+ av_dlog(NULL, "Val = 0 encountered!\n");
423423
424424 q = (base_tab[pos] * quant) >> 9;
425425 if (q > 1)
@@ -563,7 +563,7 @@ void ff_ivi_process_empty_tile(AVCodecContext *avctx, IVIBandDesc *band, · 137 unmodified lines
563563 }
564564
565565
566−#if IVI_DEBUG
566+#ifdef DEBUG
567567 uint16_t ivi_calc_band_checksum (IVIBandDesc *band)
568568 {
569569 int x, y;
libavcodec/ivi_common.h+0−4
@@ -33,8 +33,6 @@ · 32 unmodified lines
3333 #include "get_bits.h"
3434 #include <stdint.h>
3535
36−#define IVI_DEBUG 0
37−
3836 #define IVI_VLC_BITS 13 ///< max number of bits of the ivi's huffman codes
3937
4038 /**
@@ -340,7 +338,6 @@ void ff_ivi_process_empty_tile(AVCodecContext *avctx, IVIBandDesc *band, · 299 unmodified lines
340338 */
341339 void ff_ivi_output_plane(IVIPlaneDesc *plane, uint8_t *dst, int dst_pitch);
342340
343−#if IVI_DEBUG
344341 /**
345342 * Calculate band checksum from band data.
346343 */
@@ -350,6 +347,5 @@ uint16_t ivi_calc_band_checksum (IVIBandDesc *band); · 3 unmodified lines
350347 * Verify that band data lies in range.
351348 */
352349 int ivi_check_band (IVIBandDesc *band, const uint8_t *ref, int pitch);
353−#endif
354350
355351 #endif /* AVCODEC_IVI_COMMON_H */
libavcodec/mpeg12.c+5−6
@@ -1670,7 +1670,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) · 1669 unmodified lines
16701670
16711671 *s->current_picture_ptr->pan_scan= s1->pan_scan;
16721672
1673− if (HAVE_PTHREADS && avctx->active_thread_type&FF_THREAD_FRAME)
1673+ if (HAVE_PTHREADS && (avctx->active_thread_type & FF_THREAD_FRAME))
16741674 ff_thread_finish_setup(avctx);
16751675 }else{ //second field
16761676 int i;
@@ -2004,7 +2004,7 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict) · 327 unmodified lines
20042004 *pict= *(AVFrame*)s->current_picture_ptr;
20052005 ff_print_debug_info(s, pict);
20062006 } else {
2007− if (avctx->active_thread_type&FF_THREAD_FRAME)
2007+ if (avctx->active_thread_type & FF_THREAD_FRAME)
20082008 s->picture_number++;
20092009 /* latency of 1 frame for I- and P-frames */
20102010 /* XXX: use another variable than picture_number */
@@ -2179,14 +2179,13 @@ static void mpeg_decode_gop(AVCodecContext *avctx, · 168 unmodified lines
21792179 Mpeg1Context *s1 = avctx->priv_data;
21802180 MpegEncContext *s = &s1->mpeg_enc_ctx;
21812181
2182− int drop_frame_flag;
21832182 int time_code_hours, time_code_minutes;
21842183 int time_code_seconds, time_code_pictures;
21852184 int broken_link;
21862185
21872186 init_get_bits(&s->gb, buf, buf_size*8);
21882187
2189− drop_frame_flag = get_bits1(&s->gb);
2188+ skip_bits1(&s->gb); /* drop_frame_flag */
21902189
21912190 time_code_hours=get_bits(&s->gb,5);
21922191 time_code_minutes = get_bits(&s->gb,6);
@@ -2340,7 +2339,7 @@ static int decode_chunks(AVCodecContext *avctx, · 147 unmodified lines
23402339 buf_ptr = ff_find_start_code(buf_ptr,buf_end, &start_code);
23412340 if (start_code > 0x1ff){
23422341 if(s2->pict_type != AV_PICTURE_TYPE_B || avctx->skip_frame <= AVDISCARD_DEFAULT){
2343− if(HAVE_THREADS && avctx->active_thread_type&FF_THREAD_SLICE){
2342+ if(HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE)){
23442343 int i;
23452344 assert(avctx->thread_count > 1);
23462345
@@ -2509,7 +2508,7 @@ static int decode_chunks(AVCodecContext *avctx, · 162 unmodified lines
25092508 break;
25102509 }
25112510
2512− if(HAVE_THREADS && avctx->active_thread_type&FF_THREAD_SLICE){
2511+ if(HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE)){
25132512 int threshold= (s2->mb_height*s->slice_count + avctx->thread_count/2) / avctx->thread_count;
25142513 assert(avctx->thread_count > 1);
25152514 if(threshold <= mb_y){
libavcodec/mpeg12enc.c+1−2
@@ -761,10 +761,9 @@ void ff_mpeg1_encode_init(MpegEncContext *s) · 760 unmodified lines
761761
762762 if(mv==0) len= ff_mpeg12_mbMotionVectorTable[0][1];
763763 else{
764− int val, bit_size, range, code;
764+ int val, bit_size, code;
765765
766766 bit_size = f_code - 1;
767− range = 1 << bit_size;
768767
769768 val=mv;
770769 if (val < 0)
libavcodec/mpeg4videodec.c+7−12
@@ -397,14 +397,13 @@ int mpeg4_decode_video_packet_header(MpegEncContext *s) · 396 unmodified lines
397397 header_extension= get_bits1(&s->gb);
398398 }
399399 if(header_extension){
400− int time_increment;
401400 int time_incr=0;
402401
403402 while (get_bits1(&s->gb) != 0)
404403 time_incr++;
405404
406405 check_marker(&s->gb, "before time_increment in video packed header");
407− time_increment= get_bits(&s->gb, s->time_increment_bits);
406+ skip_bits(&s->gb, s->time_increment_bits); /* time_increment */
408407 check_marker(&s->gb, "before vop_coding_type in video packed header");
409408
410409 skip_bits(&s->gb, 2); /* vop coding type */
@@ -1805,16 +1804,14 @@ no_cplx_est: · 1394 unmodified lines
18051804
18061805 if (s->scalability) {
18071806 GetBitContext bak= *gb;
1808− int ref_layer_id;
1809− int ref_layer_sampling_dir;
18101807 int h_sampling_factor_n;
18111808 int h_sampling_factor_m;
18121809 int v_sampling_factor_n;
18131810 int v_sampling_factor_m;
18141811
18151812 s->hierachy_type= get_bits1(gb);
1816− ref_layer_id= get_bits(gb, 4);
1817− ref_layer_sampling_dir= get_bits1(gb);
1813+ skip_bits(gb, 4); /* ref_layer_id */
1814+ skip_bits1(gb); /* ref_layer_sampling_dir */
18181815 h_sampling_factor_n= get_bits(gb, 5);
18191816 h_sampling_factor_m= get_bits(gb, 5);
18201817 v_sampling_factor_n= get_bits(gb, 5);
@@ -1993,15 +1990,13 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){ · 172 unmodified lines
19931990
19941991 if (s->shape != RECT_SHAPE) {
19951992 if (s->vol_sprite_usage != 1 || s->pict_type != AV_PICTURE_TYPE_I) {
1996− int width, height, hor_spat_ref, ver_spat_ref;
1997−
1998− width = get_bits(gb, 13);
1993+ skip_bits(gb, 13); /* width */
19991994 skip_bits1(gb); /* marker */
2000− height = get_bits(gb, 13);
1995+ skip_bits(gb, 13); /* height */
20011996 skip_bits1(gb); /* marker */
2002− hor_spat_ref = get_bits(gb, 13); /* hor_spat_ref */
1997+ skip_bits(gb, 13); /* hor_spat_ref */
20031998 skip_bits1(gb); /* marker */
2004− ver_spat_ref = get_bits(gb, 13); /* ver_spat_ref */
1999+ skip_bits(gb, 13); /* ver_spat_ref */
20052000 }
20062001 skip_bits1(gb); /* change_CR_disable */
20072002
libavcodec/mpegvideo.c+5−3
@@ -527,7 +527,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst, const AVCodecContext *src · 526 unmodified lines
527527 s->last_pict_type= s1->pict_type;
528528 if (s1->current_picture_ptr) s->last_lambda_for[s1->pict_type] = s1->current_picture_ptr->quality;
529529
530− if(s1->pict_type!=AV_PICTURE_TYPE_B){
530+ if(s1->pict_type!=FF_B_TYPE){
531531 s->last_non_b_pict_type= s1->pict_type;
532532 }
533533 }
@@ -586,7 +586,8 @@ av_cold int MPV_common_init(MpegEncContext *s) · 52 unmodified lines
586586 return -1;
587587 }
588588
589− if(s->avctx->active_thread_type&FF_THREAD_SLICE &&
589+
590+ if((s->avctx->active_thread_type & FF_THREAD_SLICE) &&
590591 (s->avctx->thread_count > MAX_THREADS || (s->avctx->thread_count > s->mb_height && s->mb_height))){
591592 av_log(s->avctx, AV_LOG_ERROR, "too many threads\n");
592593 return -1;
@@ -763,6 +764,7 @@ av_cold int MPV_common_init(MpegEncContext *s) · 170 unmodified lines
763764 if(init_duplicate_context(s, s) < 0) goto fail;
764765 s->start_mb_y = 0;
765766 s->end_mb_y = s->mb_height;
767+
766768 }
767769
768770 return 0;
@@ -2634,6 +2636,6 @@ void ff_set_qscale(MpegEncContext * s, int qscale) · 1865 unmodified lines
26342636
26352637 void MPV_report_decode_progress(MpegEncContext *s)
26362638 {
2637− if (s->pict_type != AV_PICTURE_TYPE_B && !s->partitioned_frame)
2639+ if (s->pict_type != FF_B_TYPE && !s->partitioned_frame && !s->error_occurred)
26382640 ff_thread_report_progress((AVFrame*)s->current_picture_ptr, s->mb_y, 0);
26392641 }
libavcodec/mpegvideo.h+1−1
@@ -474,7 +474,7 @@ typedef struct MpegEncContext { · 473 unmodified lines
474474 int last_bits; ///< temp var used for calculating the above vars
475475
476476 /* error concealment / resync */
477− int error_count;
477+ int error_count, error_occurred;
478478 uint8_t *error_status_table; ///< table of the error status of each MB
479479 #define VP_START 1 ///< current MB is the first after a resync marker
480480 #define AC_ERROR 2
libavcodec/mpegvideo_enc.c+1−1
@@ -2759,7 +2759,7 @@ static int encode_picture(MpegEncContext *s, int picture_number) · 2758 unmodified lines
27592759 {
27602760 int i;
27612761 int bits;
2762− int context_count = s->avctx->active_thread_type&FF_THREAD_SLICE ? s->avctx->thread_count : 1;
2762+ int context_count = (s->avctx->active_thread_type & FF_THREAD_SLICE) ? s->avctx->thread_count : 1;
27632763
27642764 s->picture_number = picture_number;
27652765
libavcodec/mpegvideo_parser.c+1−2
@@ -32,7 +32,7 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, · 31 unmodified lines
3232 uint32_t start_code;
3333 int frame_rate_index, ext_type, bytes_left;
3434 int frame_rate_ext_n, frame_rate_ext_d;
35− int picture_structure, top_field_first, repeat_first_field, progressive_frame;
35+ int top_field_first, repeat_first_field, progressive_frame;
3636 int horiz_size_ext, vert_size_ext, bit_rate_ext;
3737 int did_set_size=0;
3838 //FIXME replace the crap with get_bits()
@@ -91,7 +91,6 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, · 52 unmodified lines
9191 break;
9292 case 0x8: /* picture coding extension */
9393 if (bytes_left >= 5) {
94− picture_structure = buf[2]&3;
9594 top_field_first = buf[3] & (1 << 7);
9695 repeat_first_field = buf[3] & (1 << 1);
9796 progressive_frame = buf[4] & (1 << 7);
libavcodec/msmpeg4.c+1−3
@@ -1528,9 +1528,7 @@ int msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size) · 1527 unmodified lines
15281528 /* the alt_bitstream reader could read over the end so we need to check it */
15291529 if(left>=length && left<length+8)
15301530 {
1531− int fps;
1532−
1533− fps= get_bits(&s->gb, 5);
1531+ skip_bits(&s->gb, 5); /* fps */
15341532 s->bit_rate= get_bits(&s->gb, 11)*1024;
15351533 if(s->msmpeg4_version>=3)
15361534 s->flipflop_rounding= get_bits1(&s->gb);
libavcodec/pngdec.c+6−7
@@ -379,7 +379,7 @@ static int decode_frame(AVCodecContext *avctx, · 378 unmodified lines
379379 AVFrame *p;
380380 uint8_t *crow_buf_base = NULL;
381381 uint32_t tag, length;
382− int ret, crc;
382+ int ret;
383383
384384 FFSWAP(AVFrame *, s->current_picture, s->last_picture);
385385 avctx->coded_frame= s->current_picture;
@@ -433,7 +433,7 @@ static int decode_frame(AVCodecContext *avctx, · 47 unmodified lines
433433 s->compression_type = *s->bytestream++;
434434 s->filter_type = *s->bytestream++;
435435 s->interlace_type = *s->bytestream++;
436− crc = bytestream_get_be32(&s->bytestream);
436+ s->bytestream += 4; /* crc */
437437 s->state |= PNG_IHDR;
438438 av_dlog(avctx, "width=%d height=%d depth=%d color_type=%d compression_type=%d filter_type=%d interlace_type=%d\n",
439439 s->width, s->height, s->bit_depth, s->color_type,
@@ -528,8 +528,7 @@ static int decode_frame(AVCodecContext *avctx, · 88 unmodified lines
528528 s->state |= PNG_IDAT;
529529 if (png_decode_idat(s, length) < 0)
530530 goto fail;
531− /* skip crc */
532− crc = bytestream_get_be32(&s->bytestream);
531+ s->bytestream += 4; /* crc */
533532 break;
534533 case MKTAG('P', 'L', 'T', 'E'):
535534 {
@@ -549,7 +548,7 @@ static int decode_frame(AVCodecContext *avctx, · 13 unmodified lines
549548 s->palette[i] = (0xff << 24);
550549 }
551550 s->state |= PNG_PLTE;
552− crc = bytestream_get_be32(&s->bytestream);
551+ s->bytestream += 4; /* crc */
553552 }
554553 break;
555554 case MKTAG('t', 'R', 'N', 'S'):
@@ -565,13 +564,13 @@ static int decode_frame(AVCodecContext *avctx, · 9 unmodified lines
565564 v = *s->bytestream++;
566565 s->palette[i] = (s->palette[i] & 0x00ffffff) | (v << 24);
567566 }
568− crc = bytestream_get_be32(&s->bytestream);
567+ s->bytestream += 4; /* crc */
569568 }
570569 break;
571570 case MKTAG('I', 'E', 'N', 'D'):
572571 if (!(s->state & PNG_ALLIMAGE))
573572 goto fail;
574− crc = bytestream_get_be32(&s->bytestream);
573+ s->bytestream += 4; /* crc */
575574 goto exit_loop;
576575 default:
577576 /* skip tag */
libavcodec/pthread.c+1−1
@@ -55,7 +55,7 @@ typedef struct ThreadContext { · 54 unmodified lines
5555 } ThreadContext;
5656
5757 /// Max number of frame buffers that can be allocated when using frame threads.
58−#define MAX_BUFFERS 33
58+#define MAX_BUFFERS (32+1)
5959
6060 /**
6161 * Context used by codec threads and stored in their AVCodecContext thread_opaque.
libavcodec/rv10.c+2−2
@@ -235,7 +235,7 @@ int rv_decode_dc(MpegEncContext *s, int n) · 234 unmodified lines
235235 /* read RV 1.0 compatible frame header */
236236 static int rv10_decode_picture_header(MpegEncContext *s)
237237 {
238− int mb_count, pb_frame, marker, unk av_unused, mb_xy;
238+ int mb_count, pb_frame, marker, mb_xy;
239239
240240 marker = get_bits1(&s->gb);
241241
@@ -282,7 +282,7 @@ static int rv10_decode_picture_header(MpegEncContext *s) · 40 unmodified lines
282282 s->mb_y = 0;
283283 mb_count = s->mb_width * s->mb_height;
284284 }
285− unk= get_bits(&s->gb, 3); /* ignored */
285+ skip_bits(&s->gb, 3); /* ignored */
286286 s->f_code = 1;
287287 s->unrestricted_mv = 1;
288288
libavcodec/s302m.c+1−2
@@ -29,7 +29,7 @@ static int s302m_parse_frame_header(AVCodecContext *avctx, const uint8_t *buf, · 28 unmodified lines
2929 int buf_size)
3030 {
3131 uint32_t h;
32− int frame_size, channels, id av_unused, bits;
32+ int frame_size, channels, bits;
3333
3434 if (buf_size <= AES3_HEADER_LEN) {
3535 av_log(avctx, AV_LOG_ERROR, "frame is too short\n");
@@ -48,7 +48,6 @@ static int s302m_parse_frame_header(AVCodecContext *avctx, const uint8_t *buf, · 12 unmodified lines
4848 h = AV_RB32(buf);
4949 frame_size = (h >> 16) & 0xffff;
5050 channels = ((h >> 14) & 0x0003) * 2 + 2;
51− id = (h >> 6) & 0x00ff;
5251 bits = ((h >> 4) & 0x0003) * 4 + 16;
5352
5453 if (AES3_HEADER_LEN + frame_size != buf_size || bits > 24) {
libavcodec/shorten.c+1−2
@@ -196,7 +196,6 @@ static int decode_wave_header(AVCodecContext *avctx, uint8_t *header, int header · 195 unmodified lines
196196 {
197197 GetBitContext hb;
198198 int len;
199− int chunk_size av_unused;
200199 short wave_format;
201200
202201 init_get_bits(&hb, header, header_size*8);
@@ -205,7 +204,7 @@ static int decode_wave_header(AVCodecContext *avctx, uint8_t *header, int header · 2 unmodified lines
205204 return -1;
206205 }
207206
208− chunk_size = get_le32(&hb);
207+ skip_bits_long(&hb, 32); /* chunk_size */
209208
210209 if (get_le32(&hb) != MKTAG('W','A','V','E')) {
211210 av_log(avctx, AV_LOG_ERROR, "missing WAVE tag\n");
libavcodec/svq1dec.c+11−23
@@ -33,7 +33,6 @@ · 32 unmodified lines
3333 */
3434
3535
36−//#define DEBUG_SVQ1
3736 #include "avcodec.h"
3837 #include "dsputil.h"
3938 #include "mpegvideo.h"
@@ -238,9 +237,9 @@ static int svq1_decode_block_intra (GetBitContext *bitbuf, uint8_t *pixels, int · 198 unmodified lines
238237 }
239238
240239 if ((stages > 0) && (level >= 4)) {
241−#ifdef DEBUG_SVQ1
242− av_log(s->avctx, AV_LOG_INFO, "Error (svq1_decode_block_intra): invalid vector: stages=%i level=%i\n",stages,level);
243−#endif
240+ av_dlog(NULL,
241+ "Error (svq1_decode_block_intra): invalid vector: stages=%i level=%i\n",
242+ stages, level);
244243 return -1; /* invalid vector */
245244 }
246245
@@ -288,9 +287,9 @@ static int svq1_decode_block_non_intra (GetBitContext *bitbuf, uint8_t *pixels, · 41 unmodified lines
288287 if (stages == -1) continue; /* skip vector */
289288
290289 if ((stages > 0) && (level >= 4)) {
291−#ifdef DEBUG_SVQ1
292− av_log(s->avctx, AV_LOG_INFO, "Error (svq1_decode_block_non_intra): invalid vector: stages=%i level=%i\n",stages,level);
293−#endif
290+ av_dlog(NULL,
291+ "Error (svq1_decode_block_non_intra): invalid vector: stages=%i level=%i\n",
292+ stages, level);
294293 return -1; /* invalid vector */
295294 }
296295
@@ -499,9 +498,7 @@ static int svq1_decode_delta_block (MpegEncContext *s, GetBitContext *bitbuf, · 202 unmodified lines
499498
500499 if (result != 0)
501500 {
502−#ifdef DEBUG_SVQ1
503− av_log(s->avctx, AV_LOG_INFO, "Error in svq1_motion_inter_block %i\n",result);
504−#endif
501+ av_dlog(s->avctx, "Error in svq1_motion_inter_block %i\n", result);
505502 break;
506503 }
507504 result = svq1_decode_block_non_intra (bitbuf, current, pitch);
@@ -512,9 +509,7 @@ static int svq1_decode_delta_block (MpegEncContext *s, GetBitContext *bitbuf, · 4 unmodified lines
512509
513510 if (result != 0)
514511 {
515−#ifdef DEBUG_SVQ1
516− av_log(s->avctx, AV_LOG_INFO, "Error in svq1_motion_inter_4v_block %i\n",result);
517−#endif
512+ av_dlog(s->avctx, "Error in svq1_motion_inter_4v_block %i\n", result);
518513 break;
519514 }
520515 result = svq1_decode_block_non_intra (bitbuf, current, pitch);
@@ -554,9 +549,8 @@ static void svq1_parse_string (GetBitContext *bitbuf, uint8_t *out) { · 33 unmodified lines
554549
555550 static int svq1_decode_frame_header (GetBitContext *bitbuf,MpegEncContext *s) {
556551 int frame_size_code;
557− int temporal_reference;
558552
559− temporal_reference = get_bits (bitbuf, 8);
553+ skip_bits(bitbuf, 8); /* temporal_reference */
560554
561555 /* frame type */
562556 s->pict_type= get_bits (bitbuf, 2)+1;
@@ -661,9 +655,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, · 98 unmodified lines
661655
662656 if (result != 0)
663657 {
664−#ifdef DEBUG_SVQ1
665− av_log(s->avctx, AV_LOG_INFO, "Error in svq1_decode_frame_header %i\n",result);
666−#endif
658+ av_dlog(s->avctx, "Error in svq1_decode_frame_header %i\n",result);
667659 return result;
668660 }
669661
@@ -712,9 +704,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, · 42 unmodified lines
712704 result = svq1_decode_block_intra (&s->gb, &current[x], linesize);
713705 if (result != 0)
714706 {
715−//#ifdef DEBUG_SVQ1
716707 av_log(s->avctx, AV_LOG_INFO, "Error in svq1_decode_block %i (keyframe)\n",result);
717−//#endif
718708 goto err;
719709 }
720710 }
@@ -730,9 +720,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, · 9 unmodified lines
730720 linesize, pmv, x, y);
731721 if (result != 0)
732722 {
733−#ifdef DEBUG_SVQ1
734− av_log(s->avctx, AV_LOG_INFO, "Error in svq1_decode_delta_block %i\n",result);
735−#endif
723+ av_dlog(s->avctx, "Error in svq1_decode_delta_block %i\n",result);
736724 goto err;
737725 }
738726 }
libavcodec/targa.c+4−3
@@ -108,18 +108,18 @@ static int decode_frame(AVCodecContext *avctx, · 107 unmodified lines
108108 AVFrame * const p= (AVFrame*)&s->picture;
109109 uint8_t *dst;
110110 int stride;
111− int idlen, pal, compr, x, y, w, h, bpp, flags;
111+ int idlen, compr, y, w, h, bpp, flags;
112112 int first_clr, colors, csize;
113113
114114 /* parse image header */
115115 CHECK_BUFFER_SIZE(buf, buf_end, 18, "header");
116116 idlen = *buf++;
117− pal = *buf++;
117+ buf++; /* pal */
118118 compr = *buf++;
119119 first_clr = AV_RL16(buf); buf += 2;
120120 colors = AV_RL16(buf); buf += 2;
121121 csize = *buf++;
122− x = AV_RL16(buf); buf += 2;
122+ buf += 2; /* x */
123123 y = AV_RL16(buf); buf += 2;
124124 w = AV_RL16(buf); buf += 2;
125125 h = AV_RL16(buf); buf += 2;
@@ -210,6 +210,7 @@ static int decode_frame(AVCodecContext *avctx, · 84 unmodified lines
210210 CHECK_BUFFER_SIZE(buf, buf_end, img_size, "image data");
211211 for(y = 0; y < s->height; y++){
212212 #if HAVE_BIGENDIAN
213+ int x;
213214 if((s->bpp + 1) >> 3 == 2){
214215 uint16_t *dst16 = (uint16_t*)dst;
215216 for(x = 0; x < s->width; x++)
libavcodec/truemotion2.c+0−13
@@ -211,19 +211,6 @@ static inline int tm2_read_header(TM2Context *ctx, const uint8_t *buf) · 210 unmodified lines
211211 /* av_log (ctx->avctx, AV_LOG_ERROR, "TM2 old header: not implemented (yet)\n"); */
212212 return 40;
213213 } else if(magic == 0x00000101) { /* new header */
214− av_unused int w, h, size, flags, xr, yr, length;
215−
216− length = AV_RL32(buf);
217− buf += 4;
218−
219− init_get_bits(&ctx->gb, buf, 32 * 8);
220− size = get_bits_long(&ctx->gb, 31);
221− h = get_bits(&ctx->gb, 15);
222− w = get_bits(&ctx->gb, 15);
223− flags = get_bits_long(&ctx->gb, 31);
224− yr = get_bits(&ctx->gb, 9);
225− xr = get_bits(&ctx->gb, 9);
226−
227214 return 40;
228215 } else {
229216 av_log (ctx->avctx, AV_LOG_ERROR, "Not a TM2 header: 0x%08X\n", magic);
libavcodec/tscc.c+0−3
@@ -75,7 +75,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 74 unmodified lines
7575 int buf_size = avpkt->size;
7676 CamtasiaContext * const c = avctx->priv_data;
7777 const unsigned char *encoded = buf;
78− unsigned char *outptr;
7978 int zret; // Zlib return code
8079 int len = buf_size;
8180
@@ -89,8 +88,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 7 unmodified lines
8988 return -1;
9089 }
9190
92− outptr = c->pic.data[0]; // Output image pointer
93−
9491 zret = inflateReset(&(c->zstream));
9592 if (zret != Z_OK) {
9693 av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret);
libavcodec/utils.c+1−1
@@ -115,7 +115,7 @@ typedef struct InternalBuffer{ · 114 unmodified lines
115115 enum PixelFormat pix_fmt;
116116 }InternalBuffer;
117117
118−#define INTERNAL_BUFFER_SIZE 33
118+#define INTERNAL_BUFFER_SIZE (32+1)
119119
120120 void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int linesize_align[4]){
121121 int w_align= 1;
libavcodec/vorbis.c+3−6
@@ -20,9 +20,6 @@ · 19 unmodified lines
2020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2121 */
2222
23−#undef V_DEBUG
24−//#define V_DEBUG
25−
2623 #define ALT_BITSTREAM_READER_LE
2724 #include "avcodec.h"
2825 #include "get_bits.h"
@@ -57,7 +54,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num) · 28 unmodified lines
5754
5855 unsigned i, j, p, code;
5956
60−#ifdef V_DEBUG
57+#ifdef DEBUG
6158 GetBitContext gb;
6259 #endif
6360
@@ -74,7 +71,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num) · 10 unmodified lines
7471 for (i = 0; i < bits[p]; ++i)
7572 exit_at_level[i+1] = 1 << i;
7673
77−#ifdef V_DEBUG
74+#ifdef DEBUG
7875 av_log(NULL, AV_LOG_INFO, " %u. of %u code len %d code %d - ", p, num, bits[p], codes[p]);
7976 init_get_bits(&gb, (uint8_t *)&codes[p], bits[p]);
8077 for (i = 0; i < bits[p]; ++i)
@@ -102,7 +99,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num) · 21 unmodified lines
10299 exit_at_level[j] = code + (1 << (j - 1));
103100 codes[p] = code;
104101
105−#ifdef V_DEBUG
102+#ifdef DEBUG
106103 av_log(NULL, AV_LOG_INFO, " %d. code len %d code %d - ", p, bits[p], codes[p]);
107104 init_get_bits(&gb, (uint8_t *)&codes[p], bits[p]);
108105 for (i = 0; i < bits[p]; ++i)
libavcodec/vorbisdec.c+106−110
@@ -20,10 +20,6 @@ · 19 unmodified lines
2020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2121 */
2222
23−#undef V_DEBUG
24−//#define V_DEBUG
25−//#define AV_DEBUG(...) av_log(NULL, AV_LOG_INFO, __VA_ARGS__)
26−
2723 #include <math.h>
2824
2925 #define ALT_BITSTREAM_READER_LE
@@ -41,10 +37,6 @@ · 11 unmodified lines
4137 #define V_MAX_VLCS (1 << 16)
4238 #define V_MAX_PARTITIONS (1 << 20)
4339
44−#ifndef V_DEBUG
45−#define AV_DEBUG(...)
46−#endif
47−
4840 #undef NDEBUG
4941 #include <assert.h>
5042
@@ -245,7 +237,7 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) · 194 unmodified lines
245237
246238 vc->codebook_count = get_bits(gb, 8) + 1;
247239
248− AV_DEBUG(" Codebooks: %d \n", vc->codebook_count);
240+ av_dlog(NULL, " Codebooks: %d \n", vc->codebook_count);
249241
250242 vc->codebooks = av_mallocz(vc->codebook_count * sizeof(*vc->codebooks));
251243 tmp_vlc_bits = av_mallocz(V_MAX_VLCS * sizeof(*tmp_vlc_bits));
@@ -256,7 +248,7 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) · 4 unmodified lines
256248 vorbis_codebook *codebook_setup = &vc->codebooks[cb];
257249 unsigned ordered, t, entries, used_entries = 0;
258250
259− AV_DEBUG(" %u. Codebook\n", cb);
251+ av_dlog(NULL, " %u. Codebook\n", cb);
260252
261253 if (get_bits(gb, 24) != 0x564342) {
262254 av_log(vc->avccontext, AV_LOG_ERROR,
@@ -281,17 +273,17 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) · 18 unmodified lines
281273
282274 ordered = get_bits1(gb);
283275
284− AV_DEBUG(" codebook_dimensions %d, codebook_entries %u\n",
285− codebook_setup->dimensions, entries);
276+ av_dlog(NULL, " codebook_dimensions %d, codebook_entries %u\n",
277+ codebook_setup->dimensions, entries);
286278
287279 if (!ordered) {
288280 unsigned ce, flag;
289281 unsigned sparse = get_bits1(gb);
290282
291− AV_DEBUG(" not ordered \n");
283+ av_dlog(NULL, " not ordered \n");
292284
293285 if (sparse) {
294− AV_DEBUG(" sparse \n");
286+ av_dlog(NULL, " sparse \n");
295287
296288 used_entries = 0;
297289 for (ce = 0; ce < entries; ++ce) {
@@ -303,7 +295,7 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) · 5 unmodified lines
303295 tmp_vlc_bits[ce] = 0;
304296 }
305297 } else {
306− AV_DEBUG(" not sparse \n");
298+ av_dlog(NULL, " not sparse \n");
307299
308300 used_entries = entries;
309301 for (ce = 0; ce < entries; ++ce)
@@ -313,17 +305,17 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) · 3 unmodified lines
313305 unsigned current_entry = 0;
314306 unsigned current_length = get_bits(gb, 5) + 1;
315307
316− AV_DEBUG(" ordered, current length: %u\n", current_length); //FIXME
308+ av_dlog(NULL, " ordered, current length: %u\n", current_length); //FIXME
317309
318310 used_entries = entries;
319311 for (; current_entry < used_entries && current_length <= 32; ++current_length) {
320312 unsigned i, number;
321313
322− AV_DEBUG(" number bits: %u ", ilog(entries - current_entry));
314+ av_dlog(NULL, " number bits: %u ", ilog(entries - current_entry));
323315
324316 number = get_bits(gb, ilog(entries - current_entry));
325317
326− AV_DEBUG(" number: %u\n", number);
318+ av_dlog(NULL, " number: %u\n", number);
327319
328320 for (i = current_entry; i < number+current_entry; ++i)
329321 if (i < used_entries)
@@ -339,7 +331,8 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) · 9 unmodified lines
339331
340332 codebook_setup->lookup_type = get_bits(gb, 4);
341333
342− AV_DEBUG(" lookup type: %d : %s \n", codebook_setup->lookup_type, codebook_setup->lookup_type ? "vq" : "no lookup");
334+ av_dlog(NULL, " lookup type: %d : %s \n", codebook_setup->lookup_type,
335+ codebook_setup->lookup_type ? "vq" : "no lookup");
343336
344337 // If the codebook is used for (inverse) VQ, calculate codevectors.
345338
@@ -352,14 +345,17 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) · 6 unmodified lines
352345 unsigned codebook_value_bits = get_bits(gb, 4) + 1;
353346 unsigned codebook_sequence_p = get_bits1(gb);
354347
355− AV_DEBUG(" We expect %d numbers for building the codevectors. \n", codebook_lookup_values);
356− AV_DEBUG(" delta %f minmum %f \n", codebook_delta_value, codebook_minimum_value);
348+ av_dlog(NULL, " We expect %d numbers for building the codevectors. \n",
349+ codebook_lookup_values);
350+ av_dlog(NULL, " delta %f minmum %f \n",
351+ codebook_delta_value, codebook_minimum_value);
357352
358353 for (i = 0; i < codebook_lookup_values; ++i) {
359354 codebook_multiplicands[i] = get_bits(gb, codebook_value_bits);
360355
361− AV_DEBUG(" multiplicands*delta+minmum : %e \n", (float)codebook_multiplicands[i]*codebook_delta_value+codebook_minimum_value);
362− AV_DEBUG(" multiplicand %u\n", codebook_multiplicands[i]);
356+ av_dlog(NULL, " multiplicands*delta+minmum : %e \n",
357+ (float)codebook_multiplicands[i] * codebook_delta_value + codebook_minimum_value);
358+ av_dlog(NULL, " multiplicand %u\n", codebook_multiplicands[i]);
363359 }
364360
365361 // Weed out unused vlcs and build codevector vector
@@ -374,9 +370,7 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) · 8 unmodified lines
374370 float last = 0.0;
375371 unsigned lookup_offset = i;
376372
377−#ifdef V_DEBUG
378− av_log(vc->avccontext, AV_LOG_INFO, "Lookup offset %u ,", i);
379−#endif
373+ av_dlog(vc->avccontext, "Lookup offset %u ,", i);
380374
381375 for (k = 0; k < dim; ++k) {
382376 unsigned multiplicand_offset = lookup_offset % codebook_lookup_values;
@@ -387,12 +381,11 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) · 4 unmodified lines
387381 }
388382 tmp_vlc_bits[j] = tmp_vlc_bits[i];
389383
390−#ifdef V_DEBUG
391− av_log(vc->avccontext, AV_LOG_INFO, "real lookup offset %u, vector: ", j);
384+ av_dlog(vc->avccontext, "real lookup offset %u, vector: ", j);
392385 for (k = 0; k < dim; ++k)
393− av_log(vc->avccontext, AV_LOG_INFO, " %f ", codebook_setup->codevectors[j * dim + k]);
394− av_log(vc->avccontext, AV_LOG_INFO, "\n");
395−#endif
386+ av_dlog(vc->avccontext, " %f ",
387+ codebook_setup->codevectors[j * dim + k]);
388+ av_dlog(vc->avccontext, "\n");
396389
397390 ++j;
398391 }
@@ -453,8 +446,8 @@ static int vorbis_parse_setup_hdr_tdtransforms(vorbis_context *vc) · 54 unmodified lines
453446 for (i = 0; i < vorbis_time_count; ++i) {
454447 unsigned vorbis_tdtransform = get_bits(gb, 16);
455448
456− AV_DEBUG(" Vorbis time domain transform %u: %u\n",
457− vorbis_time_count, vorbis_tdtransform);
449+ av_dlog(NULL, " Vorbis time domain transform %u: %u\n",
450+ vorbis_time_count, vorbis_tdtransform);
458451
459452 if (vorbis_tdtransform) {
460453 av_log(vc->avccontext, AV_LOG_ERROR, "Vorbis time domain transform data nonzero. \n");
@@ -485,7 +478,7 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc) · 24 unmodified lines
485478
486479 floor_setup->floor_type = get_bits(gb, 16);
487480
488− AV_DEBUG(" %d. floor type %d \n", i, floor_setup->floor_type);
481+ av_dlog(NULL, " %d. floor type %d \n", i, floor_setup->floor_type);
489482
490483 if (floor_setup->floor_type == 1) {
491484 int maximum_class = -1;
@@ -495,29 +488,33 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc) · 3 unmodified lines
495488
496489 floor_setup->data.t1.partitions = get_bits(gb, 5);
497490
498− AV_DEBUG(" %d.floor: %d partitions \n", i, floor_setup->data.t1.partitions);
491+ av_dlog(NULL, " %d.floor: %d partitions \n",
492+ i, floor_setup->data.t1.partitions);
499493
500494 for (j = 0; j < floor_setup->data.t1.partitions; ++j) {
501495 floor_setup->data.t1.partition_class[j] = get_bits(gb, 4);
502496 if (floor_setup->data.t1.partition_class[j] > maximum_class)
503497 maximum_class = floor_setup->data.t1.partition_class[j];
504498
505− AV_DEBUG(" %d. floor %d partition class %d \n", i, j, floor_setup->data.t1.partition_class[j]);
499+ av_dlog(NULL, " %d. floor %d partition class %d \n",
500+ i, j, floor_setup->data.t1.partition_class[j]);
506501
507502 }
508503
509− AV_DEBUG(" maximum class %d \n", maximum_class);
504+ av_dlog(NULL, " maximum class %d \n", maximum_class);
510505
511506 for (j = 0; j <= maximum_class; ++j) {
512507 floor_setup->data.t1.class_dimensions[j] = get_bits(gb, 3) + 1;
513508 floor_setup->data.t1.class_subclasses[j] = get_bits(gb, 2);
514509
515− 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]);
510+ av_dlog(NULL, " %d floor %d class dim: %d subclasses %d \n", i, j,
511+ floor_setup->data.t1.class_dimensions[j],
512+ floor_setup->data.t1.class_subclasses[j]);
516513
517514 if (floor_setup->data.t1.class_subclasses[j]) {
518515 GET_VALIDATED_INDEX(floor_setup->data.t1.class_masterbook[j], 8, vc->codebook_count)
519516
520− AV_DEBUG(" masterbook: %d \n", floor_setup->data.t1.class_masterbook[j]);
517+ av_dlog(NULL, " masterbook: %d \n", floor_setup->data.t1.class_masterbook[j]);
521518 }
522519
523520 for (k = 0; k < (1 << floor_setup->data.t1.class_subclasses[j]); ++k) {
@@ -526,7 +523,7 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc) · 2 unmodified lines
526523 VALIDATE_INDEX(bits, vc->codebook_count)
527524 floor_setup->data.t1.subclass_books[j][k] = bits;
528525
529− AV_DEBUG(" book %d. : %d \n", k, floor_setup->data.t1.subclass_books[j][k]);
526+ av_dlog(NULL, " book %d. : %d \n", k, floor_setup->data.t1.subclass_books[j][k]);
530527 }
531528 }
532529
@@ -555,8 +552,8 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc) · 22 unmodified lines
555552 for (k = 0; k < floor_setup->data.t1.class_dimensions[floor_setup->data.t1.partition_class[j]]; ++k, ++floor1_values) {
556553 floor_setup->data.t1.list[floor1_values].x = get_bits(gb, rangebits);
557554
558− AV_DEBUG(" %u. floor1 Y coord. %d\n", floor1_values,
559− floor_setup->data.t1.list[floor1_values].x);
555+ av_dlog(NULL, " %u. floor1 Y coord. %d\n", floor1_values,
556+ floor_setup->data.t1.list[floor1_values].x);
560557 }
561558 }
562559
@@ -608,28 +605,26 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc) · 45 unmodified lines
608605 if (!floor_setup->data.t0.lsp)
609606 return -1;
610607
611−#ifdef V_DEBUG /* debug output parsed headers */
612− AV_DEBUG("floor0 order: %u\n", floor_setup->data.t0.order);
613− AV_DEBUG("floor0 rate: %u\n", floor_setup->data.t0.rate);
614− AV_DEBUG("floor0 bark map size: %u\n",
615− floor_setup->data.t0.bark_map_size);
616− AV_DEBUG("floor0 amplitude bits: %u\n",
617− floor_setup->data.t0.amplitude_bits);
618− AV_DEBUG("floor0 amplitude offset: %u\n",
619− floor_setup->data.t0.amplitude_offset);
620− AV_DEBUG("floor0 number of books: %u\n",
621− floor_setup->data.t0.num_books);
622− AV_DEBUG("floor0 book list pointer: %p\n",
623− floor_setup->data.t0.book_list);
608+ /* debug output parsed headers */
609+ av_dlog(NULL, "floor0 order: %u\n", floor_setup->data.t0.order);
610+ av_dlog(NULL, "floor0 rate: %u\n", floor_setup->data.t0.rate);
611+ av_dlog(NULL, "floor0 bark map size: %u\n",
612+ floor_setup->data.t0.bark_map_size);
613+ av_dlog(NULL, "floor0 amplitude bits: %u\n",
614+ floor_setup->data.t0.amplitude_bits);
615+ av_dlog(NULL, "floor0 amplitude offset: %u\n",
616+ floor_setup->data.t0.amplitude_offset);
617+ av_dlog(NULL, "floor0 number of books: %u\n",
618+ floor_setup->data.t0.num_books);
619+ av_dlog(NULL, "floor0 book list pointer: %p\n",
620+ floor_setup->data.t0.book_list);
624621 {
625622 int idx;
626623 for (idx = 0; idx < floor_setup->data.t0.num_books; ++idx) {
627− AV_DEBUG(" Book %d: %u\n",
628− idx+1,
629− floor_setup->data.t0.book_list[idx]);
624+ av_dlog(NULL, " Book %d: %u\n", idx + 1,
625+ floor_setup->data.t0.book_list[idx]);
630626 }
631627 }
632−#endif
633628 } else {
634629 av_log(vc->avccontext, AV_LOG_ERROR, "Invalid floor type!\n");
635630 return -1;
@@ -648,7 +643,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc) · 12 unmodified lines
648643 vc->residue_count = get_bits(gb, 6)+1;
649644 vc->residues = av_mallocz(vc->residue_count * sizeof(*vc->residues));
650645
651− AV_DEBUG(" There are %d residues. \n", vc->residue_count);
646+ av_dlog(NULL, " There are %d residues. \n", vc->residue_count);
652647
653648 for (i = 0; i < vc->residue_count; ++i) {
654649 vorbis_residue *res_setup = &vc->residues[i];
@@ -657,7 +652,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc) · 2 unmodified lines
657652
658653 res_setup->type = get_bits(gb, 16);
659654
660− AV_DEBUG(" %u. residue type %d\n", i, res_setup->type);
655+ av_dlog(NULL, " %u. residue type %d\n", i, res_setup->type);
661656
662657 res_setup->begin = get_bits(gb, 24);
663658 res_setup->end = get_bits(gb, 24);
@@ -684,8 +679,9 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc) · 20 unmodified lines
684679 if (!res_setup->classifs)
685680 return AVERROR(ENOMEM);
686681
687− 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,
688− res_setup->classifications, res_setup->classbook);
682+ av_dlog(NULL, " begin %d end %d part.size %d classif.s %d classbook %d \n",
683+ res_setup->begin, res_setup->end, res_setup->partition_size,
684+ res_setup->classifications, res_setup->classbook);
689685
690686 for (j = 0; j < res_setup->classifications; ++j) {
691687 high_bits = 0;
@@ -694,7 +690,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc) · 2 unmodified lines
694690 high_bits = get_bits(gb, 5);
695691 cascade[j] = (high_bits << 3) + low_bits;
696692
697− AV_DEBUG(" %u class cascade depth: %d\n", j, ilog(cascade[j]));
693+ av_dlog(NULL, " %u class cascade depth: %d\n", j, ilog(cascade[j]));
698694 }
699695
700696 res_setup->maxpass = 0;
@@ -703,8 +699,8 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc) · 2 unmodified lines
703699 if (cascade[j]&(1 << k)) {
704700 GET_VALIDATED_INDEX(res_setup->books[j][k], 8, vc->codebook_count)
705701
706− AV_DEBUG(" %u class cascade depth %u book: %d\n",
707− j, k, res_setup->books[j][k]);
702+ av_dlog(NULL, " %u class cascade depth %u book: %d\n",
703+ j, k, res_setup->books[j][k]);
708704
709705 if (k>res_setup->maxpass)
710706 res_setup->maxpass = k;
@@ -727,7 +723,7 @@ static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc) · 16 unmodified lines
727723 vc->mapping_count = get_bits(gb, 6)+1;
728724 vc->mappings = av_mallocz(vc->mapping_count * sizeof(*vc->mappings));
729725
730− AV_DEBUG(" There are %d mappings. \n", vc->mapping_count);
726+ av_dlog(NULL, " There are %d mappings. \n", vc->mapping_count);
731727
732728 for (i = 0; i < vc->mapping_count; ++i) {
733729 vorbis_mapping *mapping_setup = &vc->mappings[i];
@@ -756,8 +752,8 @@ static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc) · 22 unmodified lines
756752 mapping_setup->coupling_steps = 0;
757753 }
758754
759− AV_DEBUG(" %u mapping coupling steps: %d\n",
760− i, mapping_setup->coupling_steps);
755+ av_dlog(NULL, " %u mapping coupling steps: %d\n",
756+ i, mapping_setup->coupling_steps);
761757
762758 if (get_bits(gb, 2)) {
763759 av_log(vc->avccontext, AV_LOG_ERROR, "%u. mapping setup data invalid.\n", i);
@@ -776,10 +772,9 @@ static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc) · 12 unmodified lines
776772 GET_VALIDATED_INDEX(mapping_setup->submap_floor[j], 8, vc->floor_count)
777773 GET_VALIDATED_INDEX(mapping_setup->submap_residue[j], 8, vc->residue_count)
778774
779− AV_DEBUG(" %u mapping %u submap : floor %d, residue %d\n",
780− i, j,
781− mapping_setup->submap_floor[j],
782− mapping_setup->submap_residue[j]);
775+ av_dlog(NULL, " %u mapping %u submap : floor %d, residue %d\n", i, j,
776+ mapping_setup->submap_floor[j],
777+ mapping_setup->submap_residue[j]);
783778 }
784779 }
785780 return 0;
@@ -814,12 +809,9 @@ static void create_map(vorbis_context *vc, unsigned floor_number) · 28 unmodified lines
814809 vf->map_size[blockflag] = n;
815810 }
816811
817−#ifdef V_DEBUG
818812 for (idx = 0; idx <= n; ++idx) {
819− AV_DEBUG("floor0 map: map at pos %d is %d\n",
820− idx, map[idx]);
813+ av_dlog(NULL, "floor0 map: map at pos %d is %d\n", idx, map[idx]);
821814 }
822−#endif
823815 }
824816
825817 static int vorbis_parse_setup_hdr_modes(vorbis_context *vc)
@@ -830,7 +822,7 @@ static int vorbis_parse_setup_hdr_modes(vorbis_context *vc) · 4 unmodified lines
830822 vc->mode_count = get_bits(gb, 6) + 1;
831823 vc->modes = av_mallocz(vc->mode_count * sizeof(*vc->modes));
832824
833− AV_DEBUG(" There are %d modes.\n", vc->mode_count);
825+ av_dlog(NULL, " There are %d modes.\n", vc->mode_count);
834826
835827 for (i = 0; i < vc->mode_count; ++i) {
836828 vorbis_mode *mode_setup = &vc->modes[i];
@@ -840,9 +832,9 @@ static int vorbis_parse_setup_hdr_modes(vorbis_context *vc) · 3 unmodified lines
840832 mode_setup->transformtype = get_bits(gb, 16); //FIXME check
841833 GET_VALIDATED_INDEX(mode_setup->mapping, 8, vc->mapping_count);
842834
843− AV_DEBUG(" %u mode: blockflag %d, windowtype %d, transformtype %d, mapping %d\n",
844− i, mode_setup->blockflag, mode_setup->windowtype,
845− mode_setup->transformtype, mode_setup->mapping);
835+ av_dlog(NULL, " %u mode: blockflag %d, windowtype %d, transformtype %d, mapping %d\n",
836+ i, mode_setup->blockflag, mode_setup->windowtype,
837+ mode_setup->transformtype, mode_setup->mapping);
846838 }
847839 return 0;
848840 }
@@ -950,7 +942,7 @@ static int vorbis_parse_id_hdr(vorbis_context *vc) · 101 unmodified lines
950942 ff_mdct_init(&vc->mdct[0], bl0, 1, -vc->scale_bias);
951943 ff_mdct_init(&vc->mdct[1], bl1, 1, -vc->scale_bias);
952944
953− AV_DEBUG(" vorbis version %d \n audio_channels %d \n audio_samplerate %d \n bitrate_max %d \n bitrate_nom %d \n bitrate_min %d \n blk_0 %d blk_1 %d \n ",
945+ av_dlog(NULL, " vorbis version %d \n audio_channels %d \n audio_samplerate %d \n bitrate_max %d \n bitrate_nom %d \n bitrate_min %d \n blk_0 %d blk_1 %d \n ",
954946 vc->version, vc->audio_channels, vc->audio_samplerate, vc->bitrate_maximum, vc->bitrate_nominal, vc->bitrate_minimum, vc->blocksize[0], vc->blocksize[1]);
955947
956948 /*
@@ -1058,7 +1050,7 @@ static int vorbis_floor0_decode(vorbis_context *vc, · 101 unmodified lines
10581050 "floor0 dec: booknumber too high!\n");
10591051 book_idx = 0;
10601052 }
1061− AV_DEBUG("floor0 dec: booknumber: %u\n", book_idx);
1053+ av_dlog(NULL, "floor0 dec: booknumber: %u\n", book_idx);
10621054 codebook = vc->codebooks[vf->book_list[book_idx]];
10631055 /* Invalid codebook! */
10641056 if (!codebook.codevectors)
@@ -1067,13 +1059,13 @@ static int vorbis_floor0_decode(vorbis_context *vc, · 2 unmodified lines
10671059 while (lsp_len<vf->order) {
10681060 int vec_off;
10691061
1070− AV_DEBUG("floor0 dec: book dimension: %d\n", codebook.dimensions);
1071− AV_DEBUG("floor0 dec: maximum depth: %d\n", codebook.maxdepth);
1062+ av_dlog(NULL, "floor0 dec: book dimension: %d\n", codebook.dimensions);
1063+ av_dlog(NULL, "floor0 dec: maximum depth: %d\n", codebook.maxdepth);
10721064 /* read temp vector */
10731065 vec_off = get_vlc2(&vc->gb, codebook.vlc.table,
10741066 codebook.nb_bits, codebook.maxdepth)
10751067 * codebook.dimensions;
1076− AV_DEBUG("floor0 dec: vector offset: %d\n", vec_off);
1068+ av_dlog(NULL, "floor0 dec: vector offset: %d\n", vec_off);
10771069 /* copy each vector component and add last to it */
10781070 for (idx = 0; idx < codebook.dimensions; ++idx)
10791071 lsp[lsp_len+idx] = codebook.codevectors[vec_off+idx] + last;
@@ -1081,14 +1073,12 @@ static int vorbis_floor0_decode(vorbis_context *vc, · 1 unmodified line
10811073
10821074 lsp_len += codebook.dimensions;
10831075 }
1084−#ifdef V_DEBUG
10851076 /* DEBUG: output lsp coeffs */
10861077 {
10871078 int idx;
10881079 for (idx = 0; idx < lsp_len; ++idx)
1089− AV_DEBUG("floor0 dec: coeff at %d is %f\n", idx, lsp[idx]);
1080+ av_dlog(NULL, "floor0 dec: coeff at %d is %f\n", idx, lsp[idx]);
10901081 }
1091−#endif
10921082
10931083 /* synthesize floor output vector */
10941084 {
@@ -1099,9 +1089,6 @@ static int vorbis_floor0_decode(vorbis_context *vc, · 4 unmodified lines
10991089 for (i = 0; i < order; i++)
11001090 lsp[i] = 2.0f * cos(lsp[i]);
11011091
1102− AV_DEBUG("floor0 synth: map_size = %d; m = %d; wstep = %f\n",
1103− vf->map_size, order, wstep);
1104−
11051092 i = 0;
11061093 while (i < vf->map_size[blockflag]) {
11071094 int j, iter_cond = vf->map[blockflag][i];
@@ -1141,7 +1128,7 @@ static int vorbis_floor0_decode(vorbis_context *vc, · 33 unmodified lines
11411128 return 1;
11421129 }
11431130
1144− AV_DEBUG(" Floor0 decoded\n");
1131+ av_dlog(NULL, " Floor0 decoded\n");
11451132
11461133 return 0;
11471134 }
@@ -1168,7 +1155,7 @@ static int vorbis_floor1_decode(vorbis_context *vc, · 20 unmodified lines
11681155 floor1_Y[0] = get_bits(gb, ilog(range - 1));
11691156 floor1_Y[1] = get_bits(gb, ilog(range - 1));
11701157
1171− AV_DEBUG("floor 0 Y %d floor 1 Y %d \n", floor1_Y[0], floor1_Y[1]);
1158+ av_dlog(NULL, "floor 0 Y %d floor 1 Y %d \n", floor1_Y[0], floor1_Y[1]);
11721159
11731160 offset = 2;
11741161 for (i = 0; i < vf->partitions; ++i) {
@@ -1178,7 +1165,7 @@ static int vorbis_floor1_decode(vorbis_context *vc, · 3 unmodified lines
11781165 csub = (1 << cbits) - 1;
11791166 cval = 0;
11801167
1181− AV_DEBUG("Cbits %u\n", cbits);
1168+ av_dlog(NULL, "Cbits %u\n", cbits);
11821169
11831170 if (cbits) // this reads all subclasses for this partition's class
11841171 cval = get_vlc2(gb, vc->codebooks[vf->class_masterbook[partition_class]].vlc.table,
@@ -1187,8 +1174,8 @@ static int vorbis_floor1_decode(vorbis_context *vc, · 2 unmodified lines
11871174 for (j = 0; j < cdim; ++j) {
11881175 book = vf->subclass_books[partition_class][cval & csub];
11891176
1190− AV_DEBUG("book %d Cbits %u cval %u bits:%d\n",
1191− book, cbits, cval, get_bits_count(gb));
1177+ av_dlog(NULL, "book %d Cbits %u cval %u bits:%d\n",
1178+ book, cbits, cval, get_bits_count(gb));
11921179
11931180 cval = cval >> cbits;
11941181 if (book > -1) {
@@ -1198,7 +1185,8 @@ static int vorbis_floor1_decode(vorbis_context *vc, · 3 unmodified lines
11981185 floor1_Y[offset+j] = 0;
11991186 }
12001187
1201− AV_DEBUG(" floor(%d) = %d \n", vf->list[offset+j].x, floor1_Y[offset+j]);
1188+ av_dlog(NULL, " floor(%d) = %d \n",
1189+ vf->list[offset+j].x, floor1_Y[offset+j]);
12021190 }
12031191 offset+=cdim;
12041192 }
@@ -1256,15 +1244,15 @@ static int vorbis_floor1_decode(vorbis_context *vc, · 51 unmodified lines
12561244 floor1_Y_final[i] = predicted;
12571245 }
12581246
1259− AV_DEBUG(" Decoded floor(%d) = %u / val %u\n",
1260− vf->list[i].x, floor1_Y_final[i], val);
1247+ av_dlog(NULL, " Decoded floor(%d) = %u / val %u\n",
1248+ vf->list[i].x, floor1_Y_final[i], val);
12611249 }
12621250
12631251 // Curve synth - connect the calculated dots and convert from dB scale FIXME optimize ?
12641252
12651253 ff_vorbis_floor1_render_list(vf->list, vf->x_list_dim, floor1_Y_final, floor1_flag, vf->multiplier, vec, vf->list[1].x);
12661254
1267− AV_DEBUG(" Floor decoded\n");
1255+ av_dlog(NULL, " Floor decoded\n");
12681256
12691257 return 0;
12701258 }
@@ -1295,7 +1283,7 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc, · 24 unmodified lines
12951283 ch_used = ch;
12961284 }
12971285
1298− AV_DEBUG(" residue type 0/1/2 decode begin, ch: %d cpc %d \n", ch, c_p_c);
1286+ av_dlog(NULL, " residue type 0/1/2 decode begin, ch: %d cpc %d \n", ch, c_p_c);
12991287
13001288 for (pass = 0; pass <= vr->maxpass; ++pass) { // FIXME OPTIMIZE?
13011289 uint16_t voffset, partition_count, j_times_ptns_to_read;
@@ -1309,7 +1297,7 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc, · 7 unmodified lines
13091297 unsigned temp = get_vlc2(gb, vc->codebooks[vr->classbook].vlc.table,
13101298 vc->codebooks[vr->classbook].nb_bits, 3);
13111299
1312− AV_DEBUG("Classword: %u\n", temp);
1300+ av_dlog(NULL, "Classword: %u\n", temp);
13131301
13141302 assert(vr->classifications > 1 && temp <= 65536); //needed for inverse[]
13151303 for (i = 0; i < c_p_c; ++i) {
@@ -1354,7 +1342,8 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc, · 38 unmodified lines
13541342 for (l = 0; l < dim; ++l, ++voffs) {
13551343 vec[voffs]+=codebook.codevectors[coffs+l]; // FPMATH
13561344
1357− AV_DEBUG(" pass %d offs: %d curr: %f change: %f cv offs.: %d \n", pass, voffs, vec[voffs], codebook.codevectors[coffs+l], coffs);
1345+ av_dlog(NULL, " pass %d offs: %d curr: %f change: %f cv offs.: %d \n",
1346+ pass, voffs, vec[voffs], codebook.codevectors[coffs+l], coffs);
13581347 }
13591348 }
13601349 } else if (vr_type == 2 && ch == 2 && (voffset & 1) == 0 && (dim & 1) == 0) { // most frequent case optimized
@@ -1381,7 +1370,10 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc, · 20 unmodified lines
13811370 vec[voffs ] += codebook.codevectors[coffs + l ]; // FPMATH
13821371 vec[voffs + vlen] += codebook.codevectors[coffs + l + 1]; // FPMATH
13831372
1384− AV_DEBUG(" pass %d offs: %d curr: %f change: %f cv offs.: %d+%d \n", pass, voffset / ch + (voffs % ch) * vlen, vec[voffset / ch + (voffs % ch) * vlen], codebook.codevectors[coffs + l], coffs, l);
1373+ av_dlog(NULL, " pass %d offs: %d curr: %f change: %f cv offs.: %d+%d \n",
1374+ pass, voffset / ch + (voffs % ch) * vlen,
1375+ vec[voffset / ch + (voffs % ch) * vlen],
1376+ codebook.codevectors[coffs + l], coffs, l);
13851377 }
13861378 }
13871379
@@ -1393,7 +1385,10 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc, · 5 unmodified lines
13931385 for (l = 0; l < dim; ++l, ++voffs) {
13941386 vec[voffs / ch + (voffs % ch) * vlen] += codebook.codevectors[coffs + l]; // FPMATH FIXME use if and counter instead of / and %
13951387
1396− AV_DEBUG(" pass %d offs: %d curr: %f change: %f cv offs.: %d+%d \n", pass, voffset / ch + (voffs % ch) * vlen, vec[voffset / ch + (voffs % ch) * vlen], codebook.codevectors[coffs + l], coffs, l);
1388+ av_dlog(NULL, " pass %d offs: %d curr: %f change: %f cv offs.: %d+%d \n",
1389+ pass, voffset / ch + (voffs % ch) * vlen,
1390+ vec[voffset / ch + (voffs % ch) * vlen],
1391+ codebook.codevectors[coffs + l], coffs, l);
13971392 }
13981393 }
13991394 }
@@ -1481,8 +1476,8 @@ static int vorbis_parse_audio_packet(vorbis_context *vc) · 81 unmodified lines
14811476 vc->mode_number = mode_number;
14821477 mapping = &vc->mappings[vc->modes[mode_number].mapping];
14831478
1484− AV_DEBUG(" Mode number: %u , mapping: %d , blocktype %d\n", mode_number,
1485− vc->modes[mode_number].mapping, vc->modes[mode_number].blockflag);
1479+ av_dlog(NULL, " Mode number: %u , mapping: %d , blocktype %d\n", mode_number,
1480+ vc->modes[mode_number].mapping, vc->modes[mode_number].blockflag);
14861481
14871482 blockflag = vc->modes[mode_number].blockflag;
14881483 blocksize = vc->blocksize[blockflag];
@@ -1611,7 +1606,7 @@ static int vorbis_decode_frame(AVCodecContext *avccontext, · 122 unmodified lines
16111606 if (!buf_size)
16121607 return 0;
16131608
1614− AV_DEBUG("packet length %d \n", buf_size);
1609+ av_dlog(NULL, "packet length %d \n", buf_size);
16151610
16161611 init_get_bits(gb, buf, buf_size*8);
16171612
@@ -1628,7 +1623,8 @@ static int vorbis_decode_frame(AVCodecContext *avccontext, · 10 unmodified lines
16281623 return buf_size ;
16291624 }
16301625
1631− AV_DEBUG("parsed %d bytes %d bits, returned %d samples (*ch*bits) \n", get_bits_count(gb)/8, get_bits_count(gb)%8, len);
1626+ av_dlog(NULL, "parsed %d bytes %d bits, returned %d samples (*ch*bits) \n",
1627+ get_bits_count(gb) / 8, get_bits_count(gb) % 8, len);
16321628
16331629 if (vc->audio_channels > 8) {
16341630 for (i = 0; i < vc->audio_channels; i++)
libavcodec/vqavideo.c+6−14
@@ -90,14 +90,6 @@ · 89 unmodified lines
9090 #define CPLZ_TAG MKBETAG('C', 'P', 'L', 'Z')
9191 #define VPTZ_TAG MKBETAG('V', 'P', 'T', 'Z')
9292
93−#define VQA_DEBUG 0
94−
95−#if VQA_DEBUG
96−#define vqa_debug printf
97−#else
98−static inline void vqa_debug(const char *format, ...) { }
99−#endif
100−
10193 typedef struct VqaContext {
10294
10395 AVCodecContext *avctx;
@@ -213,7 +205,7 @@ static void decode_format80(const unsigned char *src, int src_size, · 109 unmodified lines
213205
214206 while (src_index < src_size) {
215207
216− vqa_debug(" opcode %02X: ", src[src_index]);
208+ av_dlog(NULL, " opcode %02X: ", src[src_index]);
217209
218210 /* 0x80 means that frame is finished */
219211 if (src[src_index] == 0x80)
@@ -232,7 +224,7 @@ static void decode_format80(const unsigned char *src, int src_size, · 12 unmodified lines
232224 src_index += 2;
233225 src_pos = AV_RL16(&src[src_index]);
234226 src_index += 2;
235− vqa_debug("(1) copy %X bytes from absolute pos %X\n", count, src_pos);
227+ av_dlog(NULL, "(1) copy %X bytes from absolute pos %X\n", count, src_pos);
236228 CHECK_COUNT();
237229 for (i = 0; i < count; i++)
238230 dest[dest_index + i] = dest[src_pos + i];
@@ -244,7 +236,7 @@ static void decode_format80(const unsigned char *src, int src_size, · 5 unmodified lines
244236 count = AV_RL16(&src[src_index]);
245237 src_index += 2;
246238 color = src[src_index++];
247− vqa_debug("(2) set %X bytes to %02X\n", count, color);
239+ av_dlog(NULL, "(2) set %X bytes to %02X\n", count, color);
248240 CHECK_COUNT();
249241 memset(&dest[dest_index], color, count);
250242 dest_index += count;
@@ -254,7 +246,7 @@ static void decode_format80(const unsigned char *src, int src_size, · 3 unmodified lines
254246 count = (src[src_index++] & 0x3F) + 3;
255247 src_pos = AV_RL16(&src[src_index]);
256248 src_index += 2;
257− vqa_debug("(3) copy %X bytes from absolute pos %X\n", count, src_pos);
249+ av_dlog(NULL, "(3) copy %X bytes from absolute pos %X\n", count, src_pos);
258250 CHECK_COUNT();
259251 for (i = 0; i < count; i++)
260252 dest[dest_index + i] = dest[src_pos + i];
@@ -263,7 +255,7 @@ static void decode_format80(const unsigned char *src, int src_size, · 2 unmodified lines
263255 } else if (src[src_index] > 0x80) {
264256
265257 count = src[src_index++] & 0x3F;
266− vqa_debug("(4) copy %X bytes from source to dest\n", count);
258+ av_dlog(NULL, "(4) copy %X bytes from source to dest\n", count);
267259 CHECK_COUNT();
268260 memcpy(&dest[dest_index], &src[src_index], count);
269261 src_index += count;
@@ -274,7 +266,7 @@ static void decode_format80(const unsigned char *src, int src_size, · 4 unmodified lines
274266 count = ((src[src_index] & 0x70) >> 4) + 3;
275267 src_pos = AV_RB16(&src[src_index]) & 0x0FFF;
276268 src_index += 2;
277− vqa_debug("(5) copy %X bytes from relpos %X\n", count, src_pos);
269+ av_dlog(NULL, "(5) copy %X bytes from relpos %X\n", count, src_pos);
278270 CHECK_COUNT();
279271 for (i = 0; i < count; i++)
280272 dest[dest_index + i] = dest[dest_index - src_pos + i];
libavcodec/x86/h264_idct_10bit.asm+84−94
@@ -133,7 +133,7 @@ ADD4x4IDCT avx · 132 unmodified lines
133133 %macro ADD16_OP 3
134134 cmp byte [r4+%3], 0
135135 jz .skipblock%2
136− mov r5d, dword [r1+%2*4]
136+ mov r5d, [r1+%2*4]
137137 call add4x4_idct_%1
138138 .skipblock%2:
139139 %if %2<15
@@ -159,7 +159,7 @@ cglobal h264_idct_add16_10_%1, 5,6 · 19 unmodified lines
159159 ADD16_OP %1, 13, 7+3*8
160160 ADD16_OP %1, 14, 6+4*8
161161 ADD16_OP %1, 15, 7+4*8
162− RET
162+ REP_RET
163163 %endmacro
164164
165165 INIT_XMM
@@ -201,7 +201,7 @@ IDCT_ADD16_10 avx · 35 unmodified lines
201201
202202 INIT_MMX
203203 cglobal h264_idct_dc_add_10_mmx2,3,3
204− movd m0, dword [r1]
204+ movd m0, [r1]
205205 paddd m0, [pd_32]
206206 psrad m0, 6
207207 lea r1, [r2*3]
@@ -215,7 +215,7 @@ cglobal h264_idct_dc_add_10_mmx2,3,3 · 7 unmodified lines
215215 ;-----------------------------------------------------------------------------
216216 %macro IDCT8_DC_ADD 1
217217 cglobal h264_idct8_dc_add_10_%1,3,3,7
218− mov r1d, dword [r1]
218+ mov r1d, [r1]
219219 add r1, 32
220220 sar r1, 6
221221 movd m0, r1d
@@ -240,26 +240,27 @@ IDCT8_DC_ADD avx · 18 unmodified lines
240240 ;-----------------------------------------------------------------------------
241241 %macro AC 2
242242 .ac%2
243− mov r5d, dword [r1+(%2+0)*4]
243+ mov r5d, [r1+(%2+0)*4]
244244 call add4x4_idct_%1
245− mov r5d, dword [r1+(%2+1)*4]
245+ mov r5d, [r1+(%2+1)*4]
246246 add r2, 64
247247 call add4x4_idct_%1
248248 add r2, 64
249249 jmp .skipadd%2
250250 %endmacro
251251
252+%assign last_block 16
252253 %macro ADD16_OP_INTRA 3
253− cmp word [r4+%3], 0
254+ cmp word [r4+%3], 0
254255 jnz .ac%2
255− mov r6d, dword [r2+ 0]
256− or r6d, dword [r2+64]
256+ mov r5d, [r2+ 0]
257+ or r5d, [r2+64]
257258 jz .skipblock%2
258− mov r5d, dword [r1+(%2+0)*4]
259+ mov r5d, [r1+(%2+0)*4]
259260 call idct_dc_add_%1
260261 .skipblock%2:
261−%if %2<15
262− add r2, 128
262+%if %2<last_block-2
263+ add r2, 128
263264 %endif
264265 .skipadd%2:
265266 %endmacro
@@ -287,12 +288,15 @@ cglobal h264_idct_add16intra_10_%1,5,7,8 · 21 unmodified lines
287288 ADD16_OP_INTRA %1, 10, 4+4*8
288289 ADD16_OP_INTRA %1, 12, 6+3*8
289290 ADD16_OP_INTRA %1, 14, 6+4*8
290− RET
291−%assign i 14
292−%rep 8
293− AC %1, i
294−%assign i i-2
295−%endrep
291+ REP_RET
292+ AC %1, 8
293+ AC %1, 10
294+ AC %1, 12
295+ AC %1, 14
296+ AC %1, 0
297+ AC %1, 2
298+ AC %1, 4
299+ AC %1, 6
296300 %endmacro
297301
298302 INIT_XMM
@@ -302,47 +306,33 @@ INIT_AVX · 3 unmodified lines
302306 IDCT_ADD16INTRA_10 avx
303307 %endif
304308
309+%assign last_block 24
305310 ;-----------------------------------------------------------------------------
306311 ; h264_idct_add8(pixel **dst, const int *block_offset, dctcoef *block, int stride, const uint8_t nnzc[6*8])
307312 ;-----------------------------------------------------------------------------
308313 %macro IDCT_ADD8 1
309314 cglobal h264_idct_add8_10_%1,5,7
310− mov r5, 16
311− add r2, 1024
312−%ifdef PIC
313− lea r11, [scan8_mem]
314−%endif
315−%ifdef ARCH_X86_64
316− mov r10, r0
317−%endif
318−.nextblock:
319− movzx r6, byte [scan8+r5]
320− movzx r6, byte [r4+r6]
321− or r6d, dword [r2]
322− test r6, r6
323− jz .skipblock
324315 %ifdef ARCH_X86_64
325− mov r0d, dword [r1+r5*4]
326− add r0, [r10]
327−%else
328− mov r0, r0m
329− mov r0, [r0]
330− add r0, dword [r1+r5*4]
316+ mov r10, r0
331317 %endif
332− IDCT4_ADD_10 r0, r2, r3
333−.skipblock:
334− inc r5
335− add r2, 64
336− test r5, 3
337− jnz .nextblock
318+ add r2, 1024
319+ mov r0, [r0]
320+ ADD16_OP_INTRA %1, 16, 1+1*8
321+ ADD16_OP_INTRA %1, 18, 1+2*8
338322 %ifdef ARCH_X86_64
339− add r10, gprsize
323+ mov r0, [r10+gprsize]
340324 %else
341− add r0mp, gprsize
325+ mov r0, r0m
326+ mov r0, [r0+gprsize]
342327 %endif
343− test r5, 4
344− jnz .nextblock
328+ ADD16_OP_INTRA %1, 20, 1+4*8
329+ ADD16_OP_INTRA %1, 22, 1+5*8
345330 REP_RET
331+ AC %1, 16
332+ AC %1, 18
333+ AC %1, 20
334+ AC %1, 22
335+
346336 %endmacro ; IDCT_ADD8
347337
348338 INIT_XMM
@@ -356,51 +346,51 @@ IDCT_ADD8 avx · 7 unmodified lines
356346 ; void h264_idct8_add(pixel *dst, dctcoef *block, int stride)
357347 ;-----------------------------------------------------------------------------
358348 %macro IDCT8_1D 2
359− SWAP 0, 1
360− psrad m4, m5, 1
361− psrad m1, m0, 1
362− paddd m4, m5
363− paddd m1, m0
364− paddd m4, m7
365− paddd m1, m5
366− psubd m4, m0
367− paddd m1, m3
368−
369− psubd m0, m3
370− psubd m5, m3
371− paddd m0, m7
372− psubd m5, m7
373− psrad m3, 1
374− psrad m7, 1
375− psubd m0, m3
376− psubd m5, m7
377−
378− SWAP 1, 7
379− psrad m1, m7, 2
380− psrad m3, m4, 2
381− paddd m3, m0
382− psrad m0, 2
383− paddd m1, m5
384− psrad m5, 2
385− psubd m0, m4
386− psubd m7, m5
387−
388− SWAP 5, 6
389− psrad m4, m2, 1
390− psrad m6, m5, 1
391− psubd m4, m5
392− paddd m6, m2
393−
394− mova m2, %1
395− mova m5, %2
396− SUMSUB_BA d, 5, 2
397− SUMSUB_BA d, 6, 5
398− SUMSUB_BA d, 4, 2
399− SUMSUB_BA d, 7, 6
400− SUMSUB_BA d, 0, 4
401− SUMSUB_BA d, 3, 2
402− SUMSUB_BA d, 1, 5
403− SWAP 7, 6, 4, 5, 2, 3, 1, 0 ; 70315246 -> 01234567
349+ SWAP 0, 1
350+ psrad m4, m5, 1
351+ psrad m1, m0, 1
352+ paddd m4, m5
353+ paddd m1, m0
354+ paddd m4, m7
355+ paddd m1, m5
356+ psubd m4, m0
357+ paddd m1, m3
358+
359+ psubd m0, m3
360+ psubd m5, m3
361+ paddd m0, m7
362+ psubd m5, m7
363+ psrad m3, 1
364+ psrad m7, 1
365+ psubd m0, m3
366+ psubd m5, m7
367+
368+ SWAP 1, 7
369+ psrad m1, m7, 2
370+ psrad m3, m4, 2
371+ paddd m3, m0
372+ psrad m0, 2
373+ paddd m1, m5
374+ psrad m5, 2
375+ psubd m0, m4
376+ psubd m7, m5
377+
378+ SWAP 5, 6
379+ psrad m4, m2, 1
380+ psrad m6, m5, 1
381+ psubd m4, m5
382+ paddd m6, m2
383+
384+ mova m2, %1
385+ mova m5, %2
386+ SUMSUB_BA d, 5, 2
387+ SUMSUB_BA d, 6, 5
388+ SUMSUB_BA d, 4, 2
389+ SUMSUB_BA d, 7, 6
390+ SUMSUB_BA d, 0, 4
391+ SUMSUB_BA d, 3, 2
392+ SUMSUB_BA d, 1, 5
393+ SWAP 7, 6, 4, 5, 2, 3, 1, 0 ; 70315246 -> 01234567
404394 %endmacro
405395
406396 %macro IDCT8_1D_FULL 1
@@ -536,7 +526,7 @@ IDCT8_ADD avx · 129 unmodified lines
536526 %macro IDCT8_ADD4_OP 3
537527 cmp byte [r4+%3], 0
538528 jz .skipblock%2
539− mov r0d, dword [r6+%2*4]
529+ mov r0d, [r6+%2*4]
540530 add r0, r5
541531 call h264_idct8_add1_10_%1
542532 .skipblock%2:
libavcodec/x86/h264_intrapred.asm+0−6
@@ -836,7 +836,6 @@ PRED8x8_H ssse3 · 835 unmodified lines
836836 ;-----------------------------------------------------------------------------
837837 ; void pred8x8_top_dc_mmxext(uint8_t *src, int stride)
838838 ;-----------------------------------------------------------------------------
839−%ifdef CONFIG_GPL
840839 cglobal pred8x8_top_dc_mmxext, 2,5
841840 sub r0, r1
842841 movq mm0, [r0]
@@ -927,7 +926,6 @@ cglobal pred8x8_dc_mmxext, 2,5 · 84 unmodified lines
927926 movq [r4+r1*1], m1
928927 movq [r4+r1*2], m1
929928 RET
930−%endif
931929
932930 ;-----------------------------------------------------------------------------
933931 ; void pred8x8_dc_rv40(uint8_t *src, int stride)
@@ -1083,7 +1081,6 @@ cglobal pred8x8_tm_vp8_ssse3, 2,3,6 · 149 unmodified lines
10831081 ;-----------------------------------------------------------------------------
10841082 ; void pred8x8l_top_dc(uint8_t *src, int has_topleft, int has_topright, int stride)
10851083 ;-----------------------------------------------------------------------------
1086−%ifdef CONFIG_GPL
10871084 %macro PRED8x8L_TOP_DC 1
10881085 cglobal pred8x8l_top_dc_%1, 4,4
10891086 sub r0, r3
@@ -2476,7 +2473,6 @@ PRED8x8L_HORIZONTAL_DOWN sse2 · 1386 unmodified lines
24762473 INIT_MMX
24772474 %define PALIGNR PALIGNR_SSSE3
24782475 PRED8x8L_HORIZONTAL_DOWN ssse3
2479−%endif
24802476
24812477 ;-----------------------------------------------------------------------------
24822478 ; void pred4x4_dc_mmxext(uint8_t *src, const uint8_t *topright, int stride)
@@ -2608,7 +2604,6 @@ cglobal pred4x4_vertical_vp8_mmxext, 3,3 · 125 unmodified lines
26082604 ;-----------------------------------------------------------------------------
26092605 ; void pred4x4_down_left_mmxext(uint8_t *src, const uint8_t *topright, int stride)
26102606 ;-----------------------------------------------------------------------------
2611−%ifdef CONFIG_GPL
26122607 INIT_MMX
26132608 cglobal pred4x4_down_left_mmxext, 3,3
26142609 sub r0, r2
@@ -2786,4 +2781,3 @@ cglobal pred4x4_down_right_mmxext, 3,3 · 171 unmodified lines
27862781 psrlq m0, 8
27872782 movh [r0+r2*1], m0
27882783 RET
2789−%endif
libavcodec/x86/h264_intrapred_init.c+0−8
@@ -129,7 +129,6 @@ void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth · 128 unmodified lines
129129 h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmxext;
130130 h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_mmxext;
131131 h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmxext;
132−#if CONFIG_GPL
133132 h->pred8x8l [TOP_DC_PRED ] = ff_pred8x8l_top_dc_mmxext;
134133 h->pred8x8l [DC_PRED ] = ff_pred8x8l_dc_mmxext;
135134 h->pred8x8l [HOR_PRED ] = ff_pred8x8l_horizontal_mmxext;
@@ -142,9 +141,7 @@ void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth · 6 unmodified lines
142141 h->pred4x4 [DIAG_DOWN_RIGHT_PRED] = ff_pred4x4_down_right_mmxext;
143142 h->pred4x4 [VERT_RIGHT_PRED ] = ff_pred4x4_vertical_right_mmxext;
144143 h->pred4x4 [HOR_DOWN_PRED ] = ff_pred4x4_horizontal_down_mmxext;
145−#endif
146144 h->pred4x4 [DC_PRED ] = ff_pred4x4_dc_mmxext;
147−#if CONFIG_GPL
148145 if (codec_id == CODEC_ID_VP8 || codec_id == CODEC_ID_H264)
149146 h->pred4x4 [DIAG_DOWN_LEFT_PRED ] = ff_pred4x4_down_left_mmxext;
150147 if (codec_id == CODEC_ID_SVQ3 || codec_id == CODEC_ID_H264)
@@ -156,7 +153,6 @@ void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth · 5 unmodified lines
156153 h->pred8x8 [TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_mmxext;
157154 h->pred8x8 [DC_PRED8x8 ] = ff_pred8x8_dc_mmxext;
158155 }
159−#endif
160156 if (codec_id == CODEC_ID_VP8) {
161157 h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_mmxext;
162158 h->pred8x8 [DC_PRED8x8 ] = ff_pred8x8_dc_rv40_mmxext;
@@ -181,13 +177,11 @@ void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth · 18 unmodified lines
181177
182178 if (mm_flags & AV_CPU_FLAG_SSE2) {
183179 h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_sse2;
184−#if CONFIG_GPL
185180 h->pred8x8l [DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_sse2;
186181 h->pred8x8l [DIAG_DOWN_RIGHT_PRED] = ff_pred8x8l_down_right_sse2;
187182 h->pred8x8l [VERT_RIGHT_PRED ] = ff_pred8x8l_vertical_right_sse2;
188183 h->pred8x8l [VERT_LEFT_PRED ] = ff_pred8x8l_vertical_left_sse2;
189184 h->pred8x8l [HOR_DOWN_PRED ] = ff_pred8x8l_horizontal_down_sse2;
190−#endif
191185 if (codec_id == CODEC_ID_VP8) {
192186 h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_sse2;
193187 h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_sse2;
@@ -207,7 +201,6 @@ void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth · 13 unmodified lines
207201 h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_ssse3;
208202 h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_ssse3;
209203 h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_ssse3;
210−#if CONFIG_GPL
211204 h->pred8x8l [TOP_DC_PRED ] = ff_pred8x8l_top_dc_ssse3;
212205 h->pred8x8l [DC_PRED ] = ff_pred8x8l_dc_ssse3;
213206 h->pred8x8l [HOR_PRED ] = ff_pred8x8l_horizontal_ssse3;
@@ -218,7 +211,6 @@ void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth · 4 unmodified lines
218211 h->pred8x8l [VERT_LEFT_PRED ] = ff_pred8x8l_vertical_left_ssse3;
219212 h->pred8x8l [HOR_UP_PRED ] = ff_pred8x8l_horizontal_up_ssse3;
220213 h->pred8x8l [HOR_DOWN_PRED ] = ff_pred8x8l_horizontal_down_ssse3;
221−#endif
222214 if (codec_id == CODEC_ID_VP8) {
223215 h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_ssse3;
224216 h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_ssse3;
libavdevice/bktr.c+13−11
@@ -54,11 +54,10 @@ typedef struct { · 53 unmodified lines
5454 int video_fd;
5555 int tuner_fd;
5656 int width, height;
57− int frame_rate;
58− int frame_rate_base;
5957 uint64_t per_frame;
6058 int standard;
6159 char *video_size; /**< String describing video size, set by a private option. */
60+ char *framerate; /**< Set by a private option. */
6261 } VideoData;
6362
6463
@@ -249,8 +248,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) · 184 unmodified lines
249248 VideoData *s = s1->priv_data;
250249 AVStream *st;
251250 int width, height;
252− int frame_rate;
253− int frame_rate_base;
251+ AVRational fps;
254252 int ret = 0;
255253
256254 if (ap->time_base.den <= 0) {
@@ -262,14 +260,18 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) · 5 unmodified lines
262260 av_log(s1, AV_LOG_ERROR, "Couldn't parse video size.\n");
263261 goto out;
264262 }
263+ if ((ret = av_parse_video_rate(&fps, s->framerate)) < 0) {
264+ av_log(s1, AV_LOG_ERROR, "Couldn't parse framerate.\n");
265+ goto out;
266+ }
265267 #if FF_API_FORMAT_PARAMETERS
266268 if (ap->width > 0)
267269 width = ap->width;
268270 if (ap->height > 0)
269271 height = ap->height;
272+ if (ap->time_base.num)
273+ fps = (AVRational){ap->time_base.den, ap->time_base.num};
270274 #endif
271− frame_rate = ap->time_base.den;
272− frame_rate_base = ap->time_base.num;
273275
274276 st = av_new_stream(s1, 0);
275277 if (!st) {
@@ -280,17 +282,15 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) · 4 unmodified lines
280282
281283 s->width = width;
282284 s->height = height;
283− s->frame_rate = frame_rate;
284− s->frame_rate_base = frame_rate_base;
285− s->per_frame = ((uint64_t)1000000 * s->frame_rate_base) / s->frame_rate;
285+ s->per_frame = ((uint64_t)1000000 * fps.den) / fps.num;
286286
287287 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
288288 st->codec->pix_fmt = PIX_FMT_YUV420P;
289289 st->codec->codec_id = CODEC_ID_RAWVIDEO;
290290 st->codec->width = width;
291291 st->codec->height = height;
292− st->codec->time_base.den = frame_rate;
293− st->codec->time_base.num = frame_rate_base;
292+ st->codec->time_base.den = fps.num;
293+ st->codec->time_base.num = fps.den;
294294
295295 #if FF_API_FORMAT_PARAMETERS
296296 if (ap->standard) {
@@ -314,6 +314,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) · 17 unmodified lines
314314
315315 out:
316316 av_freep(&s->video_size);
317+ av_freep(&s->framerate);
317318 return ret;
318319 }
319320
@@ -346,6 +347,7 @@ static const AVOption options[] = { · 26 unmodified lines
346347 { "PALM", "", 0, FF_OPT_TYPE_CONST, {.dbl = PALM}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
347348 { "NTSCJ", "", 0, FF_OPT_TYPE_CONST, {.dbl = NTSCJ}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" },
348349 { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = "vga"}, 0, 0, DEC },
350+ { "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "ntsc"}, 0, 0, DEC },
349351 { NULL },
350352 };
351353
libavdevice/dv1394.c+2−9
@@ -33,9 +33,6 @@ · 32 unmodified lines
3333 #include "libavutil/log.h"
3434 #include "libavutil/opt.h"
3535 #include "avdevice.h"
36−
37−#undef DV1394_DEBUG
38−
3936 #include "libavformat/dv.h"
4037 #include "dv1394.h"
4138
@@ -177,15 +174,13 @@ restart_poll: · 135 unmodified lines
177174 av_log(context, AV_LOG_ERROR, "Failed to get status: %s\n", strerror(errno));
178175 return AVERROR(EIO);
179176 }
180−#ifdef DV1394_DEBUG
181− av_log(context, AV_LOG_DEBUG, "DV1394: status\n"
177+ av_dlog(context, "DV1394: status\n"
182178 "\tactive_frame\t%d\n"
183179 "\tfirst_clear_frame\t%d\n"
184180 "\tn_clear_frames\t%d\n"
185181 "\tdropped_frames\t%d\n",
186182 s.active_frame, s.first_clear_frame,
187183 s.n_clear_frames, s.dropped_frames);
188−#endif
189184
190185 dv->avail = s.n_clear_frames;
191186 dv->index = s.first_clear_frame;
@@ -200,10 +195,8 @@ restart_poll: · 8 unmodified lines
200195 }
201196 }
202197
203−#ifdef DV1394_DEBUG
204− av_log(context, AV_LOG_DEBUG, "index %d, avail %d, done %d\n", dv->index, dv->avail,
198+ av_dlog(context, "index %d, avail %d, done %d\n", dv->index, dv->avail,
205199 dv->done);
206−#endif
207200
208201 size = dv_produce_packet(dv->dv_demux, pkt,
209202 dv->ring + (dv->index * DV1394_PAL_FRAME_SIZE),
libavdevice/fbdev.c+36−12
@@ -37,7 +37,10 @@ · 36 unmodified lines
3737 #include <time.h>
3838 #include <linux/fb.h>
3939
40+#include "libavutil/log.h"
4041 #include "libavutil/mem.h"
42+#include "libavutil/opt.h"
43+#include "libavutil/parseutils.h"
4144 #include "libavutil/pixdesc.h"
4245 #include "avdevice.h"
4346
@@ -74,8 +77,10 @@ static enum PixelFormat get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *var · 30 unmodified lines
7477 }
7578
7679 typedef struct {
80+ AVClass *class; ///< class for private options
7781 int frame_size; ///< size in bytes of a grabbed frame
78− AVRational time_base; ///< time base
82+ AVRational fps; ///< framerate
83+ char *framerate; ///< framerate string set by a private option
7984 int64_t time_frame; ///< time for the next frame to output (in 1/1000000 units)
8085
8186 int fd; ///< framebuffer device file descriptor
@@ -97,16 +102,21 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx, · 15 unmodified lines
97102 enum PixelFormat pix_fmt;
98103 int ret, flags = O_RDONLY;
99104
105+ ret = av_parse_video_rate(&fbdev->fps, fbdev->framerate);
106+ av_freep(&fbdev->framerate);
107+ if (ret < 0) {
108+ av_log(avctx, AV_LOG_ERROR, "Couldn't parse framerate.\n");
109+ return ret;
110+ }
111+#if FF_API_FORMAT_PARAMETERS
112+ if (ap->time_base.num)
113+ fbdev->fps = (AVRational){ap->time_base.den, ap->time_base.num};
114+#endif
115+
100116 if (!(st = av_new_stream(avctx, 0)))
101117 return AVERROR(ENOMEM);
102118 av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in microseconds */
103119
104− if (ap->time_base.den <= 0) {
105− av_log(avctx, AV_LOG_ERROR, "Invalid time base %d/%d\n",
106− ap->time_base.num, ap->time_base.den);
107− return AVERROR(EINVAL);
108− }
109−
110120 /* NONBLOCK is ignored by the fbdev driver, only set for consistency */
111121 if (avctx->flags & AVFMT_FLAG_NONBLOCK)
112122 flags |= O_NONBLOCK;
@@ -146,7 +156,6 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx, · 33 unmodified lines
146156 fbdev->bytes_per_pixel = (fbdev->varinfo.bits_per_pixel + 7) >> 3;
147157 fbdev->frame_linesize = fbdev->width * fbdev->bytes_per_pixel;
148158 fbdev->frame_size = fbdev->frame_linesize * fbdev->heigth;
149− fbdev->time_base = ap->time_base;
150159 fbdev->time_frame = AV_NOPTS_VALUE;
151160 fbdev->data = mmap(NULL, fbdev->fixinfo.smem_len, PROT_READ, MAP_SHARED, fbdev->fd, 0);
152161 if (fbdev->data == MAP_FAILED) {
@@ -162,13 +171,13 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx, · 9 unmodified lines
162171 st->codec->pix_fmt = pix_fmt;
163172 st->codec->time_base = ap->time_base;
164173 st->codec->bit_rate =
165− fbdev->width * fbdev->heigth * fbdev->bytes_per_pixel / av_q2d(ap->time_base) * 8;
174+ fbdev->width * fbdev->heigth * fbdev->bytes_per_pixel * av_q2d(fbdev->fps) * 8;
166175
167176 av_log(avctx, AV_LOG_INFO,
168− "w:%d h:%d bpp:%d pixfmt:%s tb:%d/%d bit_rate:%d\n",
177+ "w:%d h:%d bpp:%d pixfmt:%s fps:%d/%d bit_rate:%d\n",
169178 fbdev->width, fbdev->heigth, fbdev->varinfo.bits_per_pixel,
170179 av_pix_fmt_descriptors[pix_fmt].name,
171− ap->time_base.num, ap->time_base.den,
180+ fbdev->fps.num, fbdev->fps.den,
172181 st->codec->bit_rate);
173182 return 0;
174183
@@ -196,7 +205,7 @@ static int fbdev_read_packet(AVFormatContext *avctx, AVPacket *pkt) · 21 unmodified lines
196205 "time_frame:%"PRId64" curtime:%"PRId64" delay:%"PRId64"\n",
197206 fbdev->time_frame, curtime, delay);
198207 if (delay <= 0) {
199− fbdev->time_frame += INT64_C(1000000) * av_q2d(fbdev->time_base);
208+ fbdev->time_frame += INT64_C(1000000) / av_q2d(fbdev->fps);
200209 break;
201210 }
202211 if (avctx->flags & AVFMT_FLAG_NONBLOCK)
@@ -240,6 +249,20 @@ av_cold static int fbdev_read_close(AVFormatContext *avctx) · 37 unmodified lines
240249 return 0;
241250 }
242251
252+#define OFFSET(x) offsetof(FBDevContext, x)
253+#define DEC AV_OPT_FLAG_DECODING_PARAM
254+static const AVOption options[] = {
255+ { "framerate","", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC },
256+ { NULL },
257+};
258+
259+static const AVClass fbdev_class = {
260+ .class_name = "fbdev indev",
261+ .item_name = av_default_item_name,
262+ .option = options,
263+ .version = LIBAVUTIL_VERSION_INT,
264+};
265+
243266 AVInputFormat ff_fbdev_demuxer = {
244267 .name = "fbdev",
245268 .long_name = NULL_IF_CONFIG_SMALL("Linux framebuffer"),
@@ -248,4 +271,5 @@ AVInputFormat ff_fbdev_demuxer = { · 2 unmodified lines
248271 .read_packet = fbdev_read_packet,
249272 .read_close = fbdev_read_close,
250273 .flags = AVFMT_NOFILE,
274+ .priv_class = &fbdev_class,
251275 };
libavdevice/libdc1394.c+257−189
@@ -2,7 +2,6 @@ · 1 unmodified line
22 * IIDC1394 grab interface (uses libdc1394 and libraw1394)
33 * Copyright (c) 2004 Roman Shaposhnik
44 * Copyright (c) 2008 Alessandro Sappia
5− * Copyright (c) 2011 Martin Lambers
65 *
76 * This file is part of FFmpeg.
87 *
@@ -22,47 +21,63 @@ · 13 unmodified lines
2221 */
2322
2423 #include "config.h"
24+#include "libavformat/avformat.h"
2525 #include "libavutil/log.h"
2626 #include "libavutil/opt.h"
27−#include "avdevice.h"
28−
29−#include <stdlib.h>
30−#include <string.h>
3127 #include "libavutil/parseutils.h"
3228 #include "libavutil/pixdesc.h"
3329
30+#if HAVE_LIBDC1394_2
3431 #include <dc1394/dc1394.h>
32+#elif HAVE_LIBDC1394_1
33+#include <libraw1394/raw1394.h>
34+#include <libdc1394/dc1394_control.h>
35+
36+#define DC1394_VIDEO_MODE_320x240_YUV422 MODE_320x240_YUV422
37+#define DC1394_VIDEO_MODE_640x480_YUV411 MODE_640x480_YUV411
38+#define DC1394_VIDEO_MODE_640x480_YUV422 MODE_640x480_YUV422
39+#define DC1394_FRAMERATE_1_875 FRAMERATE_1_875
40+#define DC1394_FRAMERATE_3_75 FRAMERATE_3_75
41+#define DC1394_FRAMERATE_7_5 FRAMERATE_7_5
42+#define DC1394_FRAMERATE_15 FRAMERATE_15
43+#define DC1394_FRAMERATE_30 FRAMERATE_30
44+#define DC1394_FRAMERATE_60 FRAMERATE_60
45+#define DC1394_FRAMERATE_120 FRAMERATE_120
46+#define DC1394_FRAMERATE_240 FRAMERATE_240
47+#endif
3548
3649 #undef free
3750
3851 typedef struct dc1394_data {
3952 AVClass *class;
53+#if HAVE_LIBDC1394_1
54+ raw1394handle_t handle;
55+ dc1394_cameracapture camera;
56+ int channel;
57+#elif HAVE_LIBDC1394_2
4058 dc1394_t *d;
4159 dc1394camera_t *camera;
4260 dc1394video_frame_t *frame;
61+#endif
4362 int current_frame;
44− int fps;
63+ int frame_rate; /**< frames per 1000 seconds (fps * 1000) */
4564 char *video_size; /**< String describing video size, set by a private option. */
4665 char *pixel_format; /**< Set by a private option. */
66+ char *framerate; /**< Set by a private option. */
4767
4868 AVPacket packet;
4969 } dc1394_data;
5070
51−/* The list of color codings that we support.
52− * We assume big endian for the dc1394 16bit modes: libdc1394 never sets the
53− * flag little_endian in dc1394video_frame_t. */
54−struct dc1394_color_coding {
55− int pix_fmt;
56− int score;
57− uint32_t coding;
58−} dc1394_color_codings[] = {
59− { PIX_FMT_GRAY16BE, 1000, DC1394_COLOR_CODING_MONO16 },
60− { PIX_FMT_RGB48BE, 1100, DC1394_COLOR_CODING_RGB16 },
61− { PIX_FMT_GRAY8, 1200, DC1394_COLOR_CODING_MONO8 },
62− { PIX_FMT_RGB24, 1300, DC1394_COLOR_CODING_RGB8 },
63− { PIX_FMT_UYYVYY411, 1400, DC1394_COLOR_CODING_YUV411 },
64− { PIX_FMT_UYVY422, 1500, DC1394_COLOR_CODING_YUV422 },
65− { PIX_FMT_NONE, 0, 0 } /* gotta be the last one */
71+struct dc1394_frame_format {
72+ int width;
73+ int height;
74+ enum PixelFormat pix_fmt;
75+ int frame_size_id;
76+} dc1394_frame_formats[] = {
77+ { 320, 240, PIX_FMT_UYVY422, DC1394_VIDEO_MODE_320x240_YUV422 },
78+ { 640, 480, PIX_FMT_UYYVYY411, DC1394_VIDEO_MODE_640x480_YUV411 },
79+ { 640, 480, PIX_FMT_UYVY422, DC1394_VIDEO_MODE_640x480_YUV422 },
80+ { 0, 0, 0, 0 } /* gotta be the last one */
6681 };
6782
6883 struct dc1394_frame_rate {
@@ -83,8 +98,12 @@ struct dc1394_frame_rate { · 14 unmodified lines
8398 #define OFFSET(x) offsetof(dc1394_data, x)
8499 #define DEC AV_OPT_FLAG_DECODING_PARAM
85100 static const AVOption options[] = {
101+#if HAVE_LIBDC1394_1
102+ { "channel", "", offsetof(dc1394_data, channel), FF_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
103+#endif
86104 { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = "qvga"}, 0, 0, DEC },
87105 { "pixel_format", "", OFFSET(pixel_format), FF_OPT_TYPE_STRING, {.str = "uyvy422"}, 0, 0, DEC },
106+ { "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "ntsc"}, 0, 0, DEC },
88107 { NULL },
89108 };
90109
@@ -95,183 +114,220 @@ static const AVClass libdc1394_class = { · 4 unmodified lines
95114 .version = LIBAVUTIL_VERSION_INT,
96115 };
97116
98−static int dc1394_read_header(AVFormatContext *c, AVFormatParameters * ap)
117+
118+static inline int dc1394_read_common(AVFormatContext *c, AVFormatParameters *ap,
119+ struct dc1394_frame_format **select_fmt, struct dc1394_frame_rate **select_fps)
99120 {
100121 dc1394_data* dc1394 = c->priv_data;
101− AVStream *vst;
102− const struct dc1394_color_coding *cc;
103− const struct dc1394_frame_rate *fr;
104− dc1394camera_list_t *list;
105− dc1394video_modes_t video_modes;
106− dc1394video_mode_t video_mode;
107− dc1394framerates_t frame_rates;
108− dc1394framerate_t frame_rate;
109− uint32_t dc1394_width, dc1394_height, dc1394_color_coding;
110− int rate, best_rate;
111− int score, max_score;
112− int final_width, final_height, final_pix_fmt, final_frame_rate;
113− int res, i, j;
114− int ret=-1;
115−
116− /* Now let us prep the hardware. */
117− dc1394->d = dc1394_new();
118− dc1394_camera_enumerate (dc1394->d, &list);
119− if ( !list || list->num == 0) {
120− av_log(c, AV_LOG_ERROR, "Unable to look for an IIDC camera\n\n");
122+ AVStream* vst;
123+ struct dc1394_frame_format *fmt;
124+ struct dc1394_frame_rate *fps;
125+ enum PixelFormat pix_fmt;
126+ int width, height;
127+ AVRational framerate;
128+ int ret = 0;
129+
130+ if ((pix_fmt = av_get_pix_fmt(dc1394->pixel_format)) == PIX_FMT_NONE) {
131+ av_log(c, AV_LOG_ERROR, "No such pixel format: %s.\n", dc1394->pixel_format);
132+ ret = AVERROR(EINVAL);
121133 goto out;
122134 }
123135
124− /* FIXME: To select a specific camera I need to search in list its guid */
125− dc1394->camera = dc1394_camera_new (dc1394->d, list->ids[0].guid);
126− if (list->num > 1) {
127− av_log(c, AV_LOG_INFO, "Working with the first camera found\n");
128− }
129−
130− /* Freeing list of cameras */
131− dc1394_camera_free_list (list);
132−
133− /* Get the list of video modes supported by the camera. */
134− res = dc1394_video_get_supported_modes (dc1394->camera, &video_modes);
135− if (res != DC1394_SUCCESS) {
136− av_log(c, AV_LOG_ERROR, "Could not get video formats.\n");
137− goto out_camera;
138− }
139−
140− if (dc1394->pixel_format) {
141− if ((ap->pix_fmt = av_get_pix_fmt(dc1394->pixel_format)) == PIX_FMT_NONE) {
142− av_log(c, AV_LOG_ERROR, "No such pixel format: %s.\n", dc1394->pixel_format);
143− ret = AVERROR(EINVAL);
144− goto out;
145− }
146− }
147−
148− if (dc1394->video_size) {
149− if ((ret = av_parse_video_size(&ap->width, &ap->height, dc1394->video_size)) < 0) {
150− av_log(c, AV_LOG_ERROR, "Couldn't parse video size.\n");
151− goto out;
152− }
153− }
154−
155− /* Choose the best mode. */
156− rate = (ap->time_base.num ? av_rescale(1000, ap->time_base.den, ap->time_base.num) : -1);
157− max_score = -1;
158− for (i = 0; i < video_modes.num; i++) {
159− if (video_modes.modes[i] == DC1394_VIDEO_MODE_EXIF
160− || (video_modes.modes[i] >= DC1394_VIDEO_MODE_FORMAT7_MIN
161− && video_modes.modes[i] <= DC1394_VIDEO_MODE_FORMAT7_MAX)) {
162− /* These modes are currently not supported as they would require
163− * much more work. For the remaining modes, the functions
164− * dc1394_get_image_size_from_video_mode and
165− * dc1394_get_color_coding_from_video_mode do not need to query the
166− * camera, and thus cannot fail. */
167− continue;
168− }
169− dc1394_get_color_coding_from_video_mode (NULL, video_modes.modes[i],
170− &dc1394_color_coding);
171− for (cc = dc1394_color_codings; cc->pix_fmt != PIX_FMT_NONE; cc++)
172− if (cc->coding == dc1394_color_coding)
173− break;
174− if (cc->pix_fmt == PIX_FMT_NONE) {
175− /* We currently cannot handle this color coding. */
176− continue;
177− }
178− /* Here we know that the mode is supported. Get its frame size and the list
179− * of frame rates supported by the camera for this mode. This list is sorted
180− * in ascending order according to libdc1394 example programs. */
181− dc1394_get_image_size_from_video_mode (NULL, video_modes.modes[i],
182− &dc1394_width, &dc1394_height);
183− res = dc1394_video_get_supported_framerates (dc1394->camera, video_modes.modes[i],
184− &frame_rates);
185− if (res != DC1394_SUCCESS || frame_rates.num == 0) {
186− av_log(c, AV_LOG_ERROR, "Cannot get frame rates for video mode.\n");
187− goto out_camera;
188− }
189− /* Choose the best frame rate. */
190− best_rate = -1;
191− for (j = 0; j < frame_rates.num; j++) {
192− for (fr = dc1394_frame_rates; fr->frame_rate; fr++) {
193− if (fr->frame_rate_id == frame_rates.framerates[j]) {
194− break;
195− }
196− }
197− if (!fr->frame_rate) {
198− /* This frame rate is not supported. */
199− continue;
200− }
201− best_rate = fr->frame_rate;
202− frame_rate = fr->frame_rate_id;
203− if (ap->time_base.num && rate == fr->frame_rate) {
204− /* This is the requested frame rate. */
205− break;
206− }
207− }
208− if (best_rate == -1) {
209− /* No supported rate found. */
210− continue;
211− }
212− /* Here we know that both the mode and the rate are supported. Compute score. */
213− if (ap->width && ap->height
214− && (dc1394_width == ap->width && dc1394_height == ap->height)) {
215− score = 110000;
216− } else {
217− score = dc1394_width * 10; // 1600 - 16000
218− }
219− if (ap->pix_fmt == cc->pix_fmt) {
220− score += 90000;
221− } else {
222− score += cc->score; // 1000 - 1500
223− }
224− if (ap->time_base.num && rate == best_rate) {
225− score += 70000;
226− } else {
227− score += best_rate / 1000; // 1 - 240
228− }
229− if (score > max_score) {
230− video_mode = video_modes.modes[i];
231− final_width = dc1394_width;
232− final_height = dc1394_height;
233− final_pix_fmt = cc->pix_fmt;
234− final_frame_rate = best_rate;
235− max_score = score;
236− }
237− }
238− if (max_score == -1) {
239− av_log(c, AV_LOG_ERROR, "No suitable video mode / frame rate available.\n");
240− goto out_camera;
241− }
242− if (ap->width && ap->height && !(ap->width == final_width && ap->height == final_height)) {
243− av_log(c, AV_LOG_WARNING, "Requested frame size is not available, using fallback.\n");
136+ if ((ret = av_parse_video_size(&width, &height, dc1394->video_size)) < 0) {
137+ av_log(c, AV_LOG_ERROR, "Couldn't parse video size.\n");
138+ goto out;
244139 }
245− if (ap->pix_fmt != PIX_FMT_NONE && ap->pix_fmt != final_pix_fmt) {
246− av_log(c, AV_LOG_WARNING, "Requested pixel format is not supported, using fallback.\n");
140+ if ((ret = av_parse_video_rate(&framerate, dc1394->framerate)) < 0) {
141+ av_log(c, AV_LOG_ERROR, "Couldn't parse framerate.\n");
142+ goto out;
247143 }
248− if (ap->time_base.num && rate != final_frame_rate) {
249− av_log(c, AV_LOG_WARNING, "Requested frame rate is not available, using fallback.\n");
144+#if FF_API_FORMAT_PARAMETERS
145+ if (ap->width > 0)
146+ width = ap->width;
147+ if (ap->height > 0)
148+ height = ap->height;
149+ if (ap->pix_fmt)
150+ pix_fmt = ap->pix_fmt;
151+ if (ap->time_base.num)
152+ framerate = (AVRational){ap->time_base.den, ap->time_base.num};
153+#endif
154+ dc1394->frame_rate = av_rescale(1000, framerate.num, framerate.den);
155+
156+ for (fmt = dc1394_frame_formats; fmt->width; fmt++)
157+ if (fmt->pix_fmt == pix_fmt && fmt->width == width && fmt->height == height)
158+ break;
159+
160+ for (fps = dc1394_frame_rates; fps->frame_rate; fps++)
161+ if (fps->frame_rate == dc1394->frame_rate)
162+ break;
163+
164+ if (!fps->frame_rate || !fmt->width) {
165+ av_log(c, AV_LOG_ERROR, "Can't find matching camera format for %s, %dx%d@%d:1000fps\n", avcodec_get_pix_fmt_name(pix_fmt),
166+ width, height, dc1394->frame_rate);
167+ ret = AVERROR(EINVAL);
168+ goto out;
250169 }
251170
252171 /* create a video stream */
253172 vst = av_new_stream(c, 0);
254− if (!vst)
255− goto out_camera;
173+ if (!vst) {
174+ ret = AVERROR(ENOMEM);
175+ goto out;
176+ }
256177 av_set_pts_info(vst, 64, 1, 1000);
257178 vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
258179 vst->codec->codec_id = CODEC_ID_RAWVIDEO;
259− vst->codec->time_base.den = final_frame_rate;
260− vst->codec->time_base.num = 1000;
261− vst->codec->width = final_width;
262− vst->codec->height = final_height;
263− vst->codec->pix_fmt = final_pix_fmt;
180+ vst->codec->time_base.den = framerate.num;
181+ vst->codec->time_base.num = framerate.den;
182+ vst->codec->width = fmt->width;
183+ vst->codec->height = fmt->height;
184+ vst->codec->pix_fmt = fmt->pix_fmt;
264185
265186 /* packet init */
266187 av_init_packet(&dc1394->packet);
267− dc1394->packet.size = avpicture_get_size(final_pix_fmt, final_width, final_height);
188+ dc1394->packet.size = avpicture_get_size(fmt->pix_fmt, fmt->width, fmt->height);
268189 dc1394->packet.stream_index = vst->index;
269190 dc1394->packet.flags |= AV_PKT_FLAG_KEY;
270191
271192 dc1394->current_frame = 0;
272− dc1394->fps = final_frame_rate;
273193
274− vst->codec->bit_rate = av_rescale(dc1394->packet.size * 8, final_frame_rate, 1000);
194+ vst->codec->bit_rate = av_rescale(dc1394->packet.size * 8, fps->frame_rate, 1000);
195+ *select_fps = fps;
196+ *select_fmt = fmt;
197+out:
198+ av_freep(&dc1394->video_size);
199+ av_freep(&dc1394->pixel_format);
200+ av_freep(&dc1394->framerate);
201+ return ret;
202+}
203+
204+#if HAVE_LIBDC1394_1
205+static int dc1394_v1_read_header(AVFormatContext *c, AVFormatParameters * ap)
206+{
207+ dc1394_data* dc1394 = c->priv_data;
208+ AVStream* vst;
209+ nodeid_t* camera_nodes;
210+ int res;
211+ struct dc1394_frame_format *fmt = NULL;
212+ struct dc1394_frame_rate *fps = NULL;
213+
214+ if (dc1394_read_common(c,ap,&fmt,&fps) != 0)
215+ return -1;
216+
217+#if FF_API_FORMAT_PARAMETERS
218+ if (ap->channel)
219+ dc1394->channel = ap->channel;
220+#endif
221+
222+ /* Now let us prep the hardware. */
223+ dc1394->handle = dc1394_create_handle(0); /* FIXME: gotta have ap->port */
224+ if (!dc1394->handle) {
225+ av_log(c, AV_LOG_ERROR, "Can't acquire dc1394 handle on port %d\n", 0 /* ap->port */);
226+ goto out;
227+ }
228+ camera_nodes = dc1394_get_camera_nodes(dc1394->handle, &res, 1);
229+ if (!camera_nodes || camera_nodes[dc1394->channel] == DC1394_NO_CAMERA) {
230+ av_log(c, AV_LOG_ERROR, "There's no IIDC camera on the channel %d\n", dc1394->channel);
231+ goto out_handle;
232+ }
233+ res = dc1394_dma_setup_capture(dc1394->handle, camera_nodes[dc1394->channel],
234+ 0,
235+ FORMAT_VGA_NONCOMPRESSED,
236+ fmt->frame_size_id,
237+ SPEED_400,
238+ fps->frame_rate_id, 8, 1,
239+ c->filename,
240+ &dc1394->camera);
241+ dc1394_free_camera_nodes(camera_nodes);
242+ if (res != DC1394_SUCCESS) {
243+ av_log(c, AV_LOG_ERROR, "Can't prepare camera for the DMA capture\n");
244+ goto out_handle;
245+ }
246+
247+ res = dc1394_start_iso_transmission(dc1394->handle, dc1394->camera.node);
248+ if (res != DC1394_SUCCESS) {
249+ av_log(c, AV_LOG_ERROR, "Can't start isochronous transmission\n");
250+ goto out_handle_dma;
251+ }
252+
253+ return 0;
254+
255+out_handle_dma:
256+ dc1394_dma_unlisten(dc1394->handle, &dc1394->camera);
257+ dc1394_dma_release_camera(dc1394->handle, &dc1394->camera);
258+out_handle:
259+ dc1394_destroy_handle(dc1394->handle);
260+out:
261+ return -1;
262+}
263+
264+static int dc1394_v1_read_packet(AVFormatContext *c, AVPacket *pkt)
265+{
266+ struct dc1394_data *dc1394 = c->priv_data;
267+ int res;
268+
269+ /* discard stale frame */
270+ if (dc1394->current_frame++) {
271+ if (dc1394_dma_done_with_buffer(&dc1394->camera) != DC1394_SUCCESS)
272+ av_log(c, AV_LOG_ERROR, "failed to release %d frame\n", dc1394->current_frame);
273+ }
274+
275+ res = dc1394_dma_single_capture(&dc1394->camera);
276+
277+ if (res == DC1394_SUCCESS) {
278+ dc1394->packet.data = (uint8_t *)(dc1394->camera.capture_buffer);
279+ dc1394->packet.pts = (dc1394->current_frame * 1000000) / dc1394->frame_rate;
280+ res = dc1394->packet.size;
281+ } else {
282+ av_log(c, AV_LOG_ERROR, "DMA capture failed\n");
283+ dc1394->packet.data = NULL;
284+ res = -1;
285+ }
286+
287+ *pkt = dc1394->packet;
288+ return res;
289+}
290+
291+static int dc1394_v1_close(AVFormatContext * context)
292+{
293+ struct dc1394_data *dc1394 = context->priv_data;
294+
295+ dc1394_stop_iso_transmission(dc1394->handle, dc1394->camera.node);
296+ dc1394_dma_unlisten(dc1394->handle, &dc1394->camera);
297+ dc1394_dma_release_camera(dc1394->handle, &dc1394->camera);
298+ dc1394_destroy_handle(dc1394->handle);
299+
300+ return 0;
301+}
302+
303+#elif HAVE_LIBDC1394_2
304+static int dc1394_v2_read_header(AVFormatContext *c, AVFormatParameters * ap)
305+{
306+ dc1394_data* dc1394 = c->priv_data;
307+ dc1394camera_list_t *list;
308+ int res, i;
309+ struct dc1394_frame_format *fmt = NULL;
310+ struct dc1394_frame_rate *fps = NULL;
311+
312+ if (dc1394_read_common(c,ap,&fmt,&fps) != 0)
313+ return -1;
314+
315+ /* Now let us prep the hardware. */
316+ dc1394->d = dc1394_new();
317+ dc1394_camera_enumerate (dc1394->d, &list);
318+ if ( !list || list->num == 0) {
319+ av_log(c, AV_LOG_ERROR, "Unable to look for an IIDC camera\n\n");
320+ goto out;
321+ }
322+
323+ /* FIXME: To select a specific camera I need to search in list its guid */
324+ dc1394->camera = dc1394_camera_new (dc1394->d, list->ids[0].guid);
325+ if (list->num > 1) {
326+ av_log(c, AV_LOG_INFO, "Working with the first camera found\n");
327+ }
328+
329+ /* Freeing list of cameras */
330+ dc1394_camera_free_list (list);
275331
276332 /* Select MAX Speed possible from the cam */
277333 if (dc1394->camera->bmode_capable>0) {
@@ -289,13 +345,13 @@ static int dc1394_read_header(AVFormatContext *c, AVFormatParameters * ap) · 11 unmodified lines
289345 goto out_camera;
290346 }
291347
292− if (dc1394_video_set_mode(dc1394->camera, video_mode) != DC1394_SUCCESS) {
348+ if (dc1394_video_set_mode(dc1394->camera, fmt->frame_size_id) != DC1394_SUCCESS) {
293349 av_log(c, AV_LOG_ERROR, "Couldn't set video format\n");
294350 goto out_camera;
295351 }
296352
297− if (dc1394_video_set_framerate(dc1394->camera, frame_rate) != DC1394_SUCCESS) {
298− av_log(c, AV_LOG_ERROR, "Could not set framerate %d.\n", final_frame_rate);
353+ if (dc1394_video_set_framerate(dc1394->camera,fps->frame_rate_id) != DC1394_SUCCESS) {
354+ av_log(c, AV_LOG_ERROR, "Couldn't set framerate %d \n",fps->frame_rate);
299355 goto out_camera;
300356 }
301357 if (dc1394_capture_setup(dc1394->camera, 10, DC1394_CAPTURE_FLAGS_DEFAULT)!=DC1394_SUCCESS) {
@@ -314,13 +370,11 @@ out_camera: · 12 unmodified lines
314370 dc1394_video_set_transmission(dc1394->camera, DC1394_OFF);
315371 dc1394_camera_free (dc1394->camera);
316372 out:
317− av_freep(&dc1394->video_size);
318− av_freep(&dc1394->pixel_format);
319373 dc1394_free(dc1394->d);
320− return ret;
374+ return -1;
321375 }
322376
323−static int dc1394_read_packet(AVFormatContext *c, AVPacket *pkt)
377+static int dc1394_v2_read_packet(AVFormatContext *c, AVPacket *pkt)
324378 {
325379 struct dc1394_data *dc1394 = c->priv_data;
326380 int res;
@@ -334,7 +388,7 @@ static int dc1394_read_packet(AVFormatContext *c, AVPacket *pkt) · 7 unmodified lines
334388 res = dc1394_capture_dequeue(dc1394->camera, DC1394_CAPTURE_POLICY_WAIT, &dc1394->frame);
335389 if (res == DC1394_SUCCESS) {
336390 dc1394->packet.data = (uint8_t *)(dc1394->frame->image);
337− dc1394->packet.pts = (dc1394->current_frame * 1000000) / (dc1394->fps);
391+ dc1394->packet.pts = (dc1394->current_frame * 1000000) / (dc1394->frame_rate);
338392 res = dc1394->frame->image_bytes;
339393 } else {
340394 av_log(c, AV_LOG_ERROR, "DMA capture failed\n");
@@ -346,7 +400,7 @@ static int dc1394_read_packet(AVFormatContext *c, AVPacket *pkt) · 5 unmodified lines
346400 return res;
347401 }
348402
349−static int dc1394_close(AVFormatContext * context)
403+static int dc1394_v2_close(AVFormatContext * context)
350404 {
351405 struct dc1394_data *dc1394 = context->priv_data;
352406
@@ -360,11 +414,25 @@ static int dc1394_close(AVFormatContext * context) · 7 unmodified lines
360414
361415 AVInputFormat ff_libdc1394_demuxer = {
362416 .name = "libdc1394",
363− .long_name = NULL_IF_CONFIG_SMALL("dc1394 A/V grab"),
417+ .long_name = NULL_IF_CONFIG_SMALL("dc1394 v.2 A/V grab"),
418+ .priv_data_size = sizeof(struct dc1394_data),
419+ .read_header = dc1394_v2_read_header,
420+ .read_packet = dc1394_v2_read_packet,
421+ .read_close = dc1394_v2_close,
422+ .flags = AVFMT_NOFILE,
423+ .priv_class = &libdc1394_class,
424+};
425+
426+#endif
427+#if HAVE_LIBDC1394_1
428+AVInputFormat ff_libdc1394_demuxer = {
429+ .name = "libdc1394",
430+ .long_name = NULL_IF_CONFIG_SMALL("dc1394 v.1 A/V grab"),
364431 .priv_data_size = sizeof(struct dc1394_data),
365− .read_header = dc1394_read_header,
366− .read_packet = dc1394_read_packet,
367− .read_close = dc1394_close,
432+ .read_header = dc1394_v1_read_header,
433+ .read_packet = dc1394_v1_read_packet,
434+ .read_close = dc1394_v1_close,
368435 .flags = AVFMT_NOFILE,
369436 .priv_class = &libdc1394_class,
370437 };
438+#endif
libavdevice/v4l2.c+20−12
@@ -76,6 +76,7 @@ struct video_data { · 75 unmodified lines
7676 int channel;
7777 char *video_size; /**< String describing video size, set by a private option. */
7878 char *pixel_format; /**< Set by a private option. */
79+ char *framerate; /**< Set by a private option. */
7980 };
8081
8182 struct buff_data {
@@ -438,12 +439,19 @@ static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap) · 356 unmodified lines
438439 struct v4l2_streamparm streamparm = {0};
439440 struct v4l2_fract *tpf = &streamparm.parm.capture.timeperframe;
440441 int i, ret;
442+ AVRational fps;
441443
442444 streamparm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
443445
446+ if (s->framerate && (ret = av_parse_video_rate(&fps, s->framerate)) < 0) {
447+ av_log(s1, AV_LOG_ERROR, "Couldn't parse framerate.\n");
448+ return ret;
449+ }
444450 #if FF_API_FORMAT_PARAMETERS
445451 if (ap->channel > 0)
446452 s->channel = ap->channel;
453+ if (ap->time_base.num)
454+ fps = (AVRational){ap->time_base.den, ap->time_base.num};
447455 #endif
448456
449457 /* set tv video input */
@@ -492,34 +500,32 @@ static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap) · 42 unmodified lines
492500 }
493501 }
494502
495− if (ap->time_base.num && ap->time_base.den) {
503+ if (fps.num && fps.den) {
496504 av_log(s1, AV_LOG_DEBUG, "Setting time per frame to %d/%d\n",
497− ap->time_base.num, ap->time_base.den);
498− tpf->numerator = ap->time_base.num;
499− tpf->denominator = ap->time_base.den;
505+ fps.den, fps.num);
506+ tpf->numerator = fps.den;
507+ tpf->denominator = fps.num;
500508 if (ioctl(s->fd, VIDIOC_S_PARM, &streamparm) != 0) {
501509 av_log(s1, AV_LOG_ERROR,
502510 "ioctl set time per frame(%d/%d) failed\n",
503− ap->time_base.num, ap->time_base.den);
511+ fps.den, fps.num);
504512 return AVERROR(EIO);
505513 }
506514
507− if (ap->time_base.den != tpf->denominator ||
508− ap->time_base.num != tpf->numerator) {
515+ if (fps.num != tpf->denominator ||
516+ fps.den != tpf->numerator) {
509517 av_log(s1, AV_LOG_INFO,
510518 "The driver changed the time per frame from %d/%d to %d/%d\n",
511− ap->time_base.num, ap->time_base.den,
519+ fps.den, fps.num,
512520 tpf->numerator, tpf->denominator);
513521 }
514522 } else {
515− /* if timebase value is not set in ap, read the timebase value from the driver */
523+ /* if timebase value is not set, read the timebase value from the driver */
516524 if (ioctl(s->fd, VIDIOC_G_PARM, &streamparm) != 0) {
517525 av_log(s1, AV_LOG_ERROR, "ioctl(VIDIOC_G_PARM): %s\n", strerror(errno));
518526 return AVERROR(errno);
519527 }
520528 }
521− ap->time_base.num = tpf->numerator;
522− ap->time_base.den = tpf->denominator;
523529
524530 return 0;
525531 }
@@ -616,7 +622,7 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap) · 90 unmodified lines
616622 desired_format = device_try_init(s1, pix_fmt, &s->width, &s->height, &codec_id);
617623 if (desired_format == 0) {
618624 av_log(s1, AV_LOG_ERROR, "Cannot find a proper format for "
619− "codec_id %d, pix_fmt %d.\n", s1->video_codec_id, ap->pix_fmt);
625+ "codec_id %d, pix_fmt %d.\n", s1->video_codec_id, pix_fmt);
620626 close(s->fd);
621627
622628 res = AVERROR(EIO);
@@ -660,6 +666,7 @@ out: · 37 unmodified lines
660666 av_freep(&s->video_size);
661667 av_freep(&s->pixel_format);
662668 av_freep(&s->standard);
669+ av_freep(&s->framerate);
663670 return res;
664671 }
665672
@@ -711,6 +718,7 @@ static const AVOption options[] = { · 45 unmodified lines
711718 { "channel", "", OFFSET(channel), FF_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
712719 { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
713720 { "pixel_format", "", OFFSET(pixel_format), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
721+ { "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
714722 { NULL },
715723 };
716724
libavdevice/vfwcap.c+11−9
@@ -26,8 +26,6 @@ · 25 unmodified lines
2626 #include <vfw.h>
2727 #include "avdevice.h"
2828
29−//#define DEBUG_VFW
30−
3129 /* Defines for VFW missing from MinGW.
3230 * Remove this when MinGW incorporates them. */
3331 #define HWND_MESSAGE ((HWND)-3)
@@ -43,6 +41,7 @@ struct vfw_ctx { · 9 unmodified lines
4341 unsigned int curbufsize;
4442 unsigned int frame_num;
4543 char *video_size; /**< A string describing video size, set by a private option. */
44+ char *framerate; /**< Set by a private option. */
4645 };
4746
4847 static enum PixelFormat vfw_pixfmt(DWORD biCompression, WORD biBitCount)
@@ -119,7 +118,7 @@ static void dump_captureparms(AVFormatContext *s, CAPTUREPARMS *cparms) · 70 unmodified lines
119118
120119 static void dump_videohdr(AVFormatContext *s, VIDEOHDR *vhdr)
121120 {
122−#ifdef DEBUG_VFW
121+#ifdef DEBUG
123122 av_log(s, AV_LOG_DEBUG, "VIDEOHDR\n");
124123 dstruct(s, vhdr, lpData, "p");
125124 dstruct(s, vhdr, dwBufferLength, "lu");
@@ -234,6 +233,7 @@ static int vfw_read_close(AVFormatContext *s) · 108 unmodified lines
234233 }
235234
236235 av_freep(&ctx->video_size);
236+ av_freep(&ctx->framerate);
237237
238238 return 0;
239239 }
@@ -250,6 +250,7 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap) · 10 unmodified lines
250250 DWORD biCompression;
251251 WORD biBitCount;
252252 int ret;
253+ AVRational fps;
253254
254255 if (!strcmp(s->filename, "list")) {
255256 for (devnum = 0; devnum <= 9; devnum++) {
@@ -267,10 +268,10 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap) · 11 unmodified lines
267268 return AVERROR(EIO);
268269 }
269270
270− if(!ap->time_base.den) {
271− av_log(s, AV_LOG_ERROR, "A time base must be specified.\n");
272− return AVERROR(EIO);
273− }
271+#if FF_API_FORMAT_PARAMETERS
272+ if (ap->time_base.num)
273+ fps = (AVRational){ap->time_base.den, ap->time_base.num};
274+#endif
274275
275276 ctx->hwnd = capCreateCaptureWindow(NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, 0);
276277 if(!ctx->hwnd) {
@@ -369,7 +370,7 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap) · 92 unmodified lines
369370
370371 cparms.fYield = 1; // Spawn a background thread
371372 cparms.dwRequestMicroSecPerFrame =
372− (ap->time_base.num*1000000) / ap->time_base.den;
373+ (fps.den*1000000) / fps.num;
373374 cparms.fAbortLeftMouse = 0;
374375 cparms.fAbortRightMouse = 0;
375376 cparms.fCaptureAudio = 0;
@@ -381,7 +382,7 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap) · 5 unmodified lines
381382 goto fail_io;
382383
383384 codec = st->codec;
384− codec->time_base = ap->time_base;
385+ codec->time_base = (AVRational){fps.den, fps.num};
385386 codec->codec_type = AVMEDIA_TYPE_VIDEO;
386387 codec->width = bi->bmiHeader.biWidth;
387388 codec->height = bi->bmiHeader.biHeight;
@@ -469,6 +470,7 @@ static int vfw_read_packet(AVFormatContext *s, AVPacket *pkt) · 81 unmodified lines
469470 #define DEC AV_OPT_FLAG_DECODING_PARAM
470471 static const AVOption options[] = {
471472 { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
473+ { "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "ntsc"}, 0, 0, DEC },
472474 { NULL },
473475 };
474476
libavformat/4xm.c+2−2
@@ -246,7 +246,7 @@ static int fourxm_read_packet(AVFormatContext *s, · 245 unmodified lines
246246 FourxmDemuxContext *fourxm = s->priv_data;
247247 AVIOContext *pb = s->pb;
248248 unsigned int fourcc_tag;
249− unsigned int size, out_size av_unused;
249+ unsigned int size;
250250 int ret = 0;
251251 unsigned int track_number;
252252 int packet_read = 0;
@@ -295,7 +295,7 @@ static int fourxm_read_packet(AVFormatContext *s, · 42 unmodified lines
295295
296296 case snd__TAG:
297297 track_number = avio_rl32(pb);
298− out_size= avio_rl32(pb);
298+ avio_skip(pb, 4);
299299 size-=8;
300300
301301 if (track_number < fourxm->track_count && fourxm->tracks[track_number].channels>0) {
libavformat/ape.c+1−3
@@ -26,8 +26,6 @@ · 25 unmodified lines
2626 #include "avformat.h"
2727 #include "apetag.h"
2828
29−#define ENABLE_DEBUG 0
30−
3129 /* The earliest and latest file formats supported by this library */
3230 #define APE_MIN_VERSION 3950
3331 #define APE_MAX_VERSION 3990
@@ -96,7 +94,7 @@ static int ape_probe(AVProbeData * p) · 62 unmodified lines
9694
9795 static void ape_dumpinfo(AVFormatContext * s, APEContext * ape_ctx)
9896 {
99−#if ENABLE_DEBUG
97+#ifdef DEBUG
10098 int i;
10199
102100 av_log(s, AV_LOG_DEBUG, "Descriptor Block:\n\n");
libavformat/apetag.c+2−4
@@ -24,8 +24,6 @@ · 23 unmodified lines
2424 #include "avformat.h"
2525 #include "apetag.h"
2626
27−#define ENABLE_DEBUG 0
28−
2927 #define APE_TAG_VERSION 2000
3028 #define APE_TAG_FOOTER_BYTES 32
3129 #define APE_TAG_FLAG_CONTAINS_HEADER (1 << 31)
@@ -35,11 +33,11 @@ static int ape_tag_read_field(AVFormatContext *s) · 3 unmodified lines
3533 {
3634 AVIOContext *pb = s->pb;
3735 uint8_t key[1024], *value;
38− uint32_t size, flags av_unused;
36+ uint32_t size;
3937 int i, c;
4038
4139 size = avio_rl32(pb); /* field size */
42− flags = avio_rl32(pb); /* field flags */
40+ avio_skip(pb, 4); /* field flags */
4341 for (i = 0; i < sizeof(key) - 1; i++) {
4442 c = avio_r8(pb);
4543 if (c < 0x20 || c > 0x7E)
libavformat/asfdec.c+8−11
@@ -209,7 +209,6 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size) · 208 unmodified lines
209209 ff_asf_guid g;
210210 enum AVMediaType type;
211211 int type_specific_size, sizeX;
212− uint64_t total_size av_unused;
213212 unsigned int tag1;
214213 int64_t pos1, pos2, start_time;
215214 int test_for_ext_stream_audio, is_dvr_ms_audio=0;
@@ -256,7 +255,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size) · 40 unmodified lines
256255 return -1;
257256 }
258257 ff_get_guid(pb, &g);
259− total_size = avio_rl64(pb);
258+ avio_skip(pb, 8); /* total_size */
260259 type_specific_size = avio_rl32(pb);
261260 avio_rl32(pb);
262261 st->id = avio_rl16(pb) & 0x7f; /* stream id */
@@ -393,7 +392,7 @@ static int asf_read_ext_stream_properties(AVFormatContext *s, int64_t size) · 130 unmodified lines
393392 AVIOContext *pb = s->pb;
394393 ff_asf_guid g;
395394 int ext_len, payload_ext_ct, stream_ct, i;
396− uint32_t ext_d av_unused, leak_rate, stream_num;
395+ uint32_t leak_rate, stream_num;
397396 unsigned int stream_languageid_index;
398397
399398 avio_rl64(pb); // starttime
@@ -427,7 +426,7 @@ static int asf_read_ext_stream_properties(AVFormatContext *s, int64_t size) · 27 unmodified lines
427426
428427 for (i=0; i<payload_ext_ct; i++){
429428 ff_get_guid(pb, &g);
430− ext_d=avio_rl16(pb);
429+ avio_skip(pb, 2);
431430 ext_len=avio_rl32(pb);
432431 avio_skip(pb, ext_len);
433432 }
@@ -511,7 +510,7 @@ static int asf_read_metadata(AVFormatContext *s, int64_t size) · 77 unmodified lines
511510 {
512511 AVIOContext *pb = s->pb;
513512 ASFContext *asf = s->priv_data;
514− int n, stream_num, name_len, value_len, value_type av_unused, value_num;
513+ int n, stream_num, name_len, value_len, value_num;
515514 int ret, i;
516515 n = avio_rl16(pb);
517516
@@ -521,7 +520,7 @@ static int asf_read_metadata(AVFormatContext *s, int64_t size) · 3 unmodified lines
521520 avio_rl16(pb); //lang_list_index
522521 stream_num= avio_rl16(pb);
523522 name_len= avio_rl16(pb);
524− value_type= avio_rl16(pb);
523+ avio_skip(pb, 2); /* value_type */
525524 value_len= avio_rl32(pb);
526525
527526 if ((ret = avio_get_str16le(pb, name_len, name, sizeof(name))) < name_len)
@@ -626,10 +625,8 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) · 98 unmodified lines
626625 // if so the next iteration will pick it up
627626 continue;
628627 } else if (!ff_guidcmp(&g, &ff_asf_head1_guid)) {
629− av_unused int v1, v2;
630628 ff_get_guid(pb, &g);
631− v1 = avio_rl32(pb);
632− v2 = avio_rl16(pb);
629+ avio_skip(pb, 6);
633630 continue;
634631 } else if (!ff_guidcmp(&g, &ff_asf_marker_header)) {
635632 asf_read_marker(s, gsize);
@@ -799,7 +796,7 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){ · 163 unmodified lines
799796 ASFContext *asf = s->priv_data;
800797 int rsize = 1;
801798 int num = avio_r8(pb);
802− int64_t ts0, ts1 av_unused;
799+ int64_t ts0;
803800
804801 asf->packet_segments--;
805802 asf->packet_key_frame = num >> 7;
@@ -822,7 +819,7 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){ · 16 unmodified lines
822819 // av_log(s, AV_LOG_DEBUG, "\n");
823820 avio_skip(pb, 10);
824821 ts0= avio_rl64(pb);
825− ts1= avio_rl64(pb);
822+ avio_skip(pb, 8);;
826823 avio_skip(pb, 12);
827824 avio_rl32(pb);
828825 avio_skip(pb, asf->packet_replic_size - 8 - 38 - 4);
libavformat/gif.c+0−4
@@ -295,9 +295,7 @@ static int gif_write_video(AVFormatContext *s, · 294 unmodified lines
295295 AVCodecContext *enc, const uint8_t *buf, int size)
296296 {
297297 AVIOContext *pb = s->pb;
298− GIFContext *gif = s->priv_data;
299298 int jiffies;
300− int64_t delay;
301299
302300 /* graphic control extension block */
303301 avio_w8(pb, 0x21);
@@ -307,8 +305,6 @@ static int gif_write_video(AVFormatContext *s, · 3 unmodified lines
307305
308306 /* 1 jiffy is 1/70 s */
309307 /* the delay_time field indicates the number of jiffies - 1 */
310− delay = gif->file_time - gif->time;
311−
312308 /* XXX: should use delay, in order to be more accurate */
313309 /* instead of using the same rounded value each time */
314310 /* XXX: don't even remember if I really use it for now */
libavformat/ipmovie.c+46−58
@@ -35,17 +35,6 @@ · 34 unmodified lines
3535 #include "libavutil/intreadwrite.h"
3636 #include "avformat.h"
3737
38−/* debugging support: #define DEBUG_IPMOVIE as non-zero to see extremely
39− * verbose information about the demux process */
40−#define DEBUG_IPMOVIE 0
41−
42−#if DEBUG_IPMOVIE
43−#undef printf
44−#define debug_ipmovie printf
45−#else
46−static inline void debug_ipmovie(const char *format, ...) { }
47−#endif
48−
4938 #define CHUNK_PREAMBLE_SIZE 4
5039 #define OPCODE_PREAMBLE_SIZE 4
5140
@@ -150,8 +139,8 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb, · 98 unmodified lines
150139 s->audio_frame_count +=
151140 (s->audio_chunk_size - 6) / s->audio_channels;
152141
153− debug_ipmovie("sending audio frame with pts %"PRId64" (%d audio frames)\n",
154− pkt->pts, s->audio_frame_count);
142+ av_dlog(NULL, "sending audio frame with pts %"PRId64" (%d audio frames)\n",
143+ pkt->pts, s->audio_frame_count);
155144
156145 chunk_type = CHUNK_VIDEO;
157146
@@ -195,8 +184,7 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb, · 37 unmodified lines
195184 pkt->stream_index = s->video_stream_index;
196185 pkt->pts = s->video_pts;
197186
198− debug_ipmovie("sending video frame with pts %"PRId64"\n",
199− pkt->pts);
187+ av_dlog(NULL, "sending video frame with pts %"PRId64"\n", pkt->pts);
200188
201189 s->video_pts += s->frame_pts_inc;
202190
@@ -244,36 +232,36 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 41 unmodified lines
244232 chunk_size = AV_RL16(&chunk_preamble[0]);
245233 chunk_type = AV_RL16(&chunk_preamble[2]);
246234
247− debug_ipmovie("chunk type 0x%04X, 0x%04X bytes: ", chunk_type, chunk_size);
235+ av_dlog(NULL, "chunk type 0x%04X, 0x%04X bytes: ", chunk_type, chunk_size);
248236
249237 switch (chunk_type) {
250238
251239 case CHUNK_INIT_AUDIO:
252− debug_ipmovie("initialize audio\n");
240+ av_dlog(NULL, "initialize audio\n");
253241 break;
254242
255243 case CHUNK_AUDIO_ONLY:
256− debug_ipmovie("audio only\n");
244+ av_dlog(NULL, "audio only\n");
257245 break;
258246
259247 case CHUNK_INIT_VIDEO:
260− debug_ipmovie("initialize video\n");
248+ av_dlog(NULL, "initialize video\n");
261249 break;
262250
263251 case CHUNK_VIDEO:
264− debug_ipmovie("video (and audio)\n");
252+ av_dlog(NULL, "video (and audio)\n");
265253 break;
266254
267255 case CHUNK_SHUTDOWN:
268− debug_ipmovie("shutdown\n");
256+ av_dlog(NULL, "shutdown\n");
269257 break;
270258
271259 case CHUNK_END:
272− debug_ipmovie("end\n");
260+ av_dlog(NULL, "end\n");
273261 break;
274262
275263 default:
276− debug_ipmovie("invalid chunk\n");
264+ av_dlog(NULL, "invalid chunk\n");
277265 chunk_type = CHUNK_BAD;
278266 break;
279267
@@ -299,29 +287,29 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 19 unmodified lines
299287 chunk_size -= OPCODE_PREAMBLE_SIZE;
300288 chunk_size -= opcode_size;
301289 if (chunk_size < 0) {
302− debug_ipmovie("chunk_size countdown just went negative\n");
290+ av_dlog(NULL, "chunk_size countdown just went negative\n");
303291 chunk_type = CHUNK_BAD;
304292 break;
305293 }
306294
307− debug_ipmovie(" opcode type %02X, version %d, 0x%04X bytes: ",
308− opcode_type, opcode_version, opcode_size);
295+ av_dlog(NULL, " opcode type %02X, version %d, 0x%04X bytes: ",
296+ opcode_type, opcode_version, opcode_size);
309297 switch (opcode_type) {
310298
311299 case OPCODE_END_OF_STREAM:
312− debug_ipmovie("end of stream\n");
300+ av_dlog(NULL, "end of stream\n");
313301 avio_skip(pb, opcode_size);
314302 break;
315303
316304 case OPCODE_END_OF_CHUNK:
317− debug_ipmovie("end of chunk\n");
305+ av_dlog(NULL, "end of chunk\n");
318306 avio_skip(pb, opcode_size);
319307 break;
320308
321309 case OPCODE_CREATE_TIMER:
322− debug_ipmovie("create timer\n");
310+ av_dlog(NULL, "create timer\n");
323311 if ((opcode_version > 0) || (opcode_size > 6)) {
324− debug_ipmovie("bad create_timer opcode\n");
312+ av_dlog(NULL, "bad create_timer opcode\n");
325313 chunk_type = CHUNK_BAD;
326314 break;
327315 }
@@ -331,14 +319,15 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 3 unmodified lines
331319 break;
332320 }
333321 s->frame_pts_inc = ((uint64_t)AV_RL32(&scratch[0])) * AV_RL16(&scratch[4]);
334− debug_ipmovie(" %.2f frames/second (timer div = %d, subdiv = %d)\n",
335− 1000000.0/s->frame_pts_inc, AV_RL32(&scratch[0]), AV_RL16(&scratch[4]));
322+ av_dlog(NULL, " %.2f frames/second (timer div = %d, subdiv = %d)\n",
323+ 1000000.0 / s->frame_pts_inc, AV_RL32(&scratch[0]),
324+ AV_RL16(&scratch[4]));
336325 break;
337326
338327 case OPCODE_INIT_AUDIO_BUFFERS:
339− debug_ipmovie("initialize audio buffers\n");
328+ av_dlog(NULL, "initialize audio buffers\n");
340329 if ((opcode_version > 1) || (opcode_size > 10)) {
341− debug_ipmovie("bad init_audio_buffers opcode\n");
330+ av_dlog(NULL, "bad init_audio_buffers opcode\n");
342331 chunk_type = CHUNK_BAD;
343332 break;
344333 }
@@ -360,23 +349,22 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 15 unmodified lines
360349 s->audio_type = CODEC_ID_PCM_S16LE;
361350 else
362351 s->audio_type = CODEC_ID_PCM_U8;
363− debug_ipmovie("audio: %d bits, %d Hz, %s, %s format\n",
364− s->audio_bits,
365− s->audio_sample_rate,
366− (s->audio_channels == 2) ? "stereo" : "mono",
367− (s->audio_type == CODEC_ID_INTERPLAY_DPCM) ?
368− "Interplay audio" : "PCM");
352+ av_dlog(NULL, "audio: %d bits, %d Hz, %s, %s format\n",
353+ s->audio_bits, s->audio_sample_rate,
354+ (s->audio_channels == 2) ? "stereo" : "mono",
355+ (s->audio_type == CODEC_ID_INTERPLAY_DPCM) ?
356+ "Interplay audio" : "PCM");
369357 break;
370358
371359 case OPCODE_START_STOP_AUDIO:
372− debug_ipmovie("start/stop audio\n");
360+ av_dlog(NULL, "start/stop audio\n");
373361 avio_skip(pb, opcode_size);
374362 break;
375363
376364 case OPCODE_INIT_VIDEO_BUFFERS:
377− debug_ipmovie("initialize video buffers\n");
365+ av_dlog(NULL, "initialize video buffers\n");
378366 if ((opcode_version > 2) || (opcode_size > 8)) {
379− debug_ipmovie("bad init_video_buffers opcode\n");
367+ av_dlog(NULL, "bad init_video_buffers opcode\n");
380368 chunk_type = CHUNK_BAD;
381369 break;
382370 }
@@ -392,8 +380,8 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 9 unmodified lines
392380 } else {
393381 s->video_bpp = 16;
394382 }
395− debug_ipmovie("video resolution: %d x %d\n",
396− s->video_width, s->video_height);
383+ av_dlog(NULL, "video resolution: %d x %d\n",
384+ s->video_width, s->video_height);
397385 break;
398386
399387 case OPCODE_UNKNOWN_06:
@@ -403,17 +391,17 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 3 unmodified lines
403391 case OPCODE_UNKNOWN_13:
404392 case OPCODE_UNKNOWN_14:
405393 case OPCODE_UNKNOWN_15:
406− debug_ipmovie("unknown (but documented) opcode %02X\n", opcode_type);
394+ av_dlog(NULL, "unknown (but documented) opcode %02X\n", opcode_type);
407395 avio_skip(pb, opcode_size);
408396 break;
409397
410398 case OPCODE_SEND_BUFFER:
411− debug_ipmovie("send buffer\n");
399+ av_dlog(NULL, "send buffer\n");
412400 avio_skip(pb, opcode_size);
413401 break;
414402
415403 case OPCODE_AUDIO_FRAME:
416− debug_ipmovie("audio frame\n");
404+ av_dlog(NULL, "audio frame\n");
417405
418406 /* log position and move on for now */
419407 s->audio_chunk_offset = avio_tell(pb);
@@ -422,26 +410,26 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 2 unmodified lines
422410 break;
423411
424412 case OPCODE_SILENCE_FRAME:
425− debug_ipmovie("silence frame\n");
413+ av_dlog(NULL, "silence frame\n");
426414 avio_skip(pb, opcode_size);
427415 break;
428416
429417 case OPCODE_INIT_VIDEO_MODE:
430− debug_ipmovie("initialize video mode\n");
418+ av_dlog(NULL, "initialize video mode\n");
431419 avio_skip(pb, opcode_size);
432420 break;
433421
434422 case OPCODE_CREATE_GRADIENT:
435− debug_ipmovie("create gradient\n");
423+ av_dlog(NULL, "create gradient\n");
436424 avio_skip(pb, opcode_size);
437425 break;
438426
439427 case OPCODE_SET_PALETTE:
440− debug_ipmovie("set palette\n");
428+ av_dlog(NULL, "set palette\n");
441429 /* check for the logical maximum palette size
442430 * (3 * 256 + 4 bytes) */
443431 if (opcode_size > 0x304) {
444− debug_ipmovie("demux_ipmovie: set_palette opcode too large\n");
432+ av_dlog(NULL, "demux_ipmovie: set_palette opcode too large\n");
445433 chunk_type = CHUNK_BAD;
446434 break;
447435 }
@@ -455,7 +443,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 7 unmodified lines
455443 last_color = first_color + AV_RL16(&scratch[2]) - 1;
456444 /* sanity check (since they are 16 bit values) */
457445 if ((first_color > 0xFF) || (last_color > 0xFF)) {
458− debug_ipmovie("demux_ipmovie: set_palette indexes out of range (%d -> %d)\n",
446+ av_dlog(NULL, "demux_ipmovie: set_palette indexes out of range (%d -> %d)\n",
459447 first_color, last_color);
460448 chunk_type = CHUNK_BAD;
461449 break;
@@ -473,12 +461,12 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 11 unmodified lines
473461 break;
474462
475463 case OPCODE_SET_PALETTE_COMPRESSED:
476− debug_ipmovie("set palette compressed\n");
464+ av_dlog(NULL, "set palette compressed\n");
477465 avio_skip(pb, opcode_size);
478466 break;
479467
480468 case OPCODE_SET_DECODING_MAP:
481− debug_ipmovie("set decoding map\n");
469+ av_dlog(NULL, "set decoding map\n");
482470
483471 /* log position and move on for now */
484472 s->decode_map_chunk_offset = avio_tell(pb);
@@ -487,7 +475,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 2 unmodified lines
487475 break;
488476
489477 case OPCODE_VIDEO_DATA:
490− debug_ipmovie("set video data\n");
478+ av_dlog(NULL, "set video data\n");
491479
492480 /* log position and move on for now */
493481 s->video_chunk_offset = avio_tell(pb);
@@ -496,7 +484,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 2 unmodified lines
496484 break;
497485
498486 default:
499− debug_ipmovie("*** unknown opcode type\n");
487+ av_dlog(NULL, "*** unknown opcode type\n");
500488 chunk_type = CHUNK_BAD;
501489 break;
502490
libavformat/mmf.c+2−2
@@ -186,13 +186,13 @@ static int mmf_read_header(AVFormatContext *s, · 185 unmodified lines
186186 unsigned int tag;
187187 AVIOContext *pb = s->pb;
188188 AVStream *st;
189− int64_t file_size av_unused, size;
189+ int64_t size;
190190 int rate, params;
191191
192192 tag = avio_rl32(pb);
193193 if (tag != MKTAG('M', 'M', 'M', 'D'))
194194 return -1;
195− file_size = avio_rb32(pb);
195+ avio_skip(pb, 4); /* file_size */
196196
197197 /* Skip some unused chunks that may or may not be present */
198198 for(;; avio_skip(pb, size)) {
libavformat/mpeg.c+3−4
@@ -572,10 +572,9 @@ static int mpegps_read_packet(AVFormatContext *s, · 571 unmodified lines
572572 pkt->dts = dts;
573573 pkt->pos = dummy_pos;
574574 pkt->stream_index = st->index;
575−#if 0
576− av_log(s, AV_LOG_DEBUG, "%d: pts=%0.3f dts=%0.3f size=%d\n",
577− pkt->stream_index, pkt->pts / 90000.0, pkt->dts / 90000.0, pkt->size);
578−#endif
575+ av_dlog(s, "%d: pts=%0.3f dts=%0.3f size=%d\n",
576+ pkt->stream_index, pkt->pts / 90000.0, pkt->dts / 90000.0,
577+ pkt->size);
579578
580579 return 0;
581580 }
libavformat/mpegenc.c+2−4
@@ -1078,10 +1078,8 @@ retry: · 1077 unmodified lines
10781078 best_dts= pkt_desc->dts;
10791079 }
10801080
1081−#if 0
1082− av_log(ctx, AV_LOG_DEBUG, "bumping scr, scr:%f, dts:%f\n",
1083− scr/90000.0, best_dts/90000.0);
1084−#endif
1081+ av_dlog(ctx, "bumping scr, scr:%f, dts:%f\n",
1082+ scr / 90000.0, best_dts / 90000.0);
10851083 if(best_dts == INT64_MAX)
10861084 return 0;
10871085
libavformat/mpegts.c+2−4
@@ -1578,10 +1578,8 @@ static int mpegts_read_header(AVFormatContext *s, · 1577 unmodified lines
15781578 s->bit_rate = (TS_PACKET_SIZE * 8) * 27e6 / ts->pcr_incr;
15791579 st->codec->bit_rate = s->bit_rate;
15801580 st->start_time = ts->cur_pcr;
1581−#if 0
1582− av_log(ts->stream, AV_LOG_DEBUG, "start=%0.3f pcr=%0.3f incr=%d\n",
1583− st->start_time / 1000000.0, pcrs[0] / 27e6, ts->pcr_incr);
1584−#endif
1581+ av_dlog(ts->stream, "start=%0.3f pcr=%0.3f incr=%d\n",
1582+ st->start_time / 1000000.0, pcrs[0] / 27e6, ts->pcr_incr);
15851583 }
15861584
15871585 avio_seek(pb, pos, SEEK_SET);
libavformat/nutdec.c+1−3
@@ -190,7 +190,6 @@ static int decode_main_header(NUTContext *nut){ · 189 unmodified lines
190190 uint64_t tmp, end;
191191 unsigned int stream_count;
192192 int i, j, tmp_stream, tmp_mul, tmp_pts, tmp_size, count, tmp_res, tmp_head_idx;
193− int64_t tmp_match;
194193
195194 end= get_packetheader(nut, bc, 1, MAIN_STARTCODE);
196195 end += avio_tell(bc);
@@ -218,7 +217,6 @@ static int decode_main_header(NUTContext *nut){ · 21 unmodified lines
218217 tmp_pts=0;
219218 tmp_mul=1;
220219 tmp_stream=0;
221− tmp_match= 1-(1LL<<62);
222220 tmp_head_idx= 0;
223221 for(i=0; i<256;){
224222 int tmp_flags = ffio_read_varlen(bc);
@@ -232,7 +230,7 @@ static int decode_main_header(NUTContext *nut){ · 7 unmodified lines
232230 else tmp_res = 0;
233231 if(tmp_fields>5) count = ffio_read_varlen(bc);
234232 else count = tmp_mul - tmp_size;
235− if(tmp_fields>6) tmp_match = get_s(bc);
233+ if(tmp_fields>6) get_s(bc);
236234 if(tmp_fields>7) tmp_head_idx= ffio_read_varlen(bc);
237235
238236 while(tmp_fields-- > 8)
libavformat/oggdec.c+1−6
@@ -197,8 +197,6 @@ static int ogg_read_page(AVFormatContext *s, int *str) · 196 unmodified lines
197197 int flags, nsegs;
198198 uint64_t gp;
199199 uint32_t serial;
200− uint32_t seq av_unused;
201− uint32_t crc av_unused;
202200 int size, idx;
203201 uint8_t sync[4];
204202 int sp = 0;
@@ -232,8 +230,7 @@ static int ogg_read_page(AVFormatContext *s, int *str) · 27 unmodified lines
232230 flags = avio_r8(bc);
233231 gp = avio_rl64 (bc);
234232 serial = avio_rl32 (bc);
235− seq = avio_rl32 (bc);
236− crc = avio_rl32 (bc);
233+ avio_skip(bc, 8); /* seq, crc */
237234 nsegs = avio_r8(bc);
238235
239236 idx = ogg_find_stream (ogg, serial);
@@ -364,8 +361,6 @@ static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize, · 124 unmodified lines
364361 }
365362 }while (!complete);
366363
367− av_dlog(s, "ogg_packet: idx %i, frame size %i, start %i\n",
368− idx, os->psize, os->pstart);
369364
370365 if (os->granule == -1)
371366 av_log(s, AV_LOG_WARNING, "Page at %"PRId64" is missing granule\n", os->page_pos);
libavformat/oggparseogm.c+1−3
@@ -39,7 +39,6 @@ ogm_header(AVFormatContext *s, int idx) · 38 unmodified lines
3939 const uint8_t *p = os->buf + os->pstart;
4040 uint64_t time_unit;
4141 uint64_t spu;
42− uint32_t default_len av_unused;
4342
4443 if(!(*p & 1))
4544 return 0;
@@ -74,8 +73,7 @@ ogm_header(AVFormatContext *s, int idx) · 28 unmodified lines
7473
7574 time_unit = bytestream_get_le64(&p);
7675 spu = bytestream_get_le64(&p);
77− default_len = bytestream_get_le32(&p);
78−
76+ p += 4; /* default_len */
7977 p += 8; /* buffersize + bits_per_sample */
8078
8179 if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){
libavformat/oma.c+2−0
@@ -80,6 +80,8 @@ static int oma_read_header(AVFormatContext *s, · 79 unmodified lines
8080
8181 ff_id3v2_read(s, ID3v2_EA3_MAGIC);
8282 ret = avio_read(s->pb, buf, EA3_HEADER_SIZE);
83+ if (ret < EA3_HEADER_SIZE)
84+ return -1;
8385
8486 if (memcmp(buf, ((const uint8_t[]){'E', 'A', '3'}),3) || buf[4] != 0 || buf[5] != EA3_HEADER_SIZE) {
8587 av_log(s, AV_LOG_ERROR, "Couldn't find the EA3 header !\n");
libavformat/rl2.c+2−4
@@ -80,8 +80,6 @@ static av_cold int rl2_read_header(AVFormatContext *s, · 79 unmodified lines
8080 unsigned int audio_frame_counter = 0;
8181 unsigned int video_frame_counter = 0;
8282 unsigned int back_size;
83− int data_size av_unused;
84− unsigned short encoding_method av_unused;
8583 unsigned short sound_rate;
8684 unsigned short rate;
8785 unsigned short channels;
@@ -98,14 +96,14 @@ static av_cold int rl2_read_header(AVFormatContext *s, · 10 unmodified lines
9896 avio_skip(pb,4); /* skip FORM tag */
9997 back_size = avio_rl32(pb); /**< get size of the background frame */
10098 signature = avio_rb32(pb);
101− data_size = avio_rb32(pb);
99+ avio_skip(pb, 4); /* data size */
102100 frame_count = avio_rl32(pb);
103101
104102 /* disallow back_sizes and frame_counts that may lead to overflows later */
105103 if(back_size > INT_MAX/2 || frame_count > INT_MAX / sizeof(uint32_t))
106104 return AVERROR_INVALIDDATA;
107105
108− encoding_method = avio_rl16(pb);
106+ avio_skip(pb, 2); /* encoding mentod */
109107 sound_rate = avio_rl16(pb);
110108 rate = avio_rl16(pb);
111109 channels = avio_rl16(pb);
libavformat/rmdec.c+2−2
@@ -280,7 +280,7 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb, · 279 unmodified lines
280280 if (rm_read_audio_stream_info(s, pb, st, rst, 0))
281281 return -1;
282282 } else {
283− int fps, fps2 av_unused;
283+ int fps;
284284 if (avio_rl32(pb) != MKTAG('V', 'I', 'D', 'O')) {
285285 fail1:
286286 av_log(st->codec, AV_LOG_ERROR, "Unsupported video codec\n");
@@ -298,7 +298,7 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb, · 11 unmodified lines
298298 fps= avio_rb16(pb);
299299 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
300300 avio_rb32(pb);
301− fps2= avio_rb16(pb);
301+ avio_skip(pb, 2);
302302 avio_rb16(pb);
303303
304304 if ((ret = rm_read_extradata(pb, st->codec, codec_data_size - (avio_tell(pb) - codec_pos))) < 0)
libavformat/rpl.c+2−2
@@ -299,9 +299,9 @@ static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt) · 298 unmodified lines
299299 stream->codec->codec_tag == 124) {
300300 // We have to split Escape 124 frames because there are
301301 // multiple frames per chunk in Escape 124 samples.
302− uint32_t frame_size, frame_flags av_unused;
302+ uint32_t frame_size;
303303
304− frame_flags = avio_rl32(pb);
304+ avio_skip(pb, 4); /* flags */
305305 frame_size = avio_rl32(pb);
306306 if (avio_seek(pb, -8, SEEK_CUR) < 0)
307307 return AVERROR(EIO);
libavformat/rtpdec_latm.c+2−3
@@ -108,8 +108,7 @@ static int parse_fmtp_config(AVStream *st, char *value) · 107 unmodified lines
108108 int len = ff_hex_to_data(NULL, value), i, ret = 0;
109109 GetBitContext gb;
110110 uint8_t *config;
111− int audio_mux_version, same_time_framing, num_sub_frames av_unused,
112− num_programs, num_layers;
111+ int audio_mux_version, same_time_framing, num_programs, num_layers;
113112
114113 /* Pad this buffer, too, to avoid out of bounds reads with get_bits below */
115114 config = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE);
@@ -119,7 +118,7 @@ static int parse_fmtp_config(AVStream *st, char *value) · 3 unmodified lines
119118 init_get_bits(&gb, config, len*8);
120119 audio_mux_version = get_bits(&gb, 1);
121120 same_time_framing = get_bits(&gb, 1);
122− num_sub_frames = get_bits(&gb, 6);
121+ skip_bits(&gb, 6); /* num_sub_frames */
123122 num_programs = get_bits(&gb, 4);
124123 num_layers = get_bits(&gb, 3);
125124 if (audio_mux_version != 0 || same_time_framing != 1 || num_programs != 0 ||
libavformat/rtsp.c+0−3
@@ -45,7 +45,6 @@ · 44 unmodified lines
4545 #include "url.h"
4646
4747 //#define DEBUG
48−//#define DEBUG_RTP_TCP
4948
5049 /* Timeout values for socket poll, in ms,
5150 * and read_packet(), in seconds */
@@ -860,9 +859,7 @@ int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply, · 808 unmodified lines
860859 q = buf;
861860 for (;;) {
862861 ret = ffurl_read_complete(rt->rtsp_hd, &ch, 1);
863−#ifdef DEBUG_RTP_TCP
864862 av_dlog(s, "ret=%d c=%02x [%c]\n", ret, ch, ch);
865−#endif
866863 if (ret != 1)
867864 return AVERROR_EOF;
868865 if (ch == '\n')
libavformat/sauce.c+2−2
@@ -32,7 +32,7 @@ int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int g · 31 unmodified lines
3232 {
3333 AVIOContext *pb = avctx->pb;
3434 char buf[36];
35− int datatype, filetype, t1, t2, nb_comments, flags av_unused;
35+ int datatype, filetype, t1, t2, nb_comments;
3636 uint64_t start_pos = avio_size(pb) - 128;
3737
3838 avio_seek(pb, start_pos, SEEK_SET);
@@ -57,7 +57,7 @@ int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int g · 18 unmodified lines
5757 t1 = avio_rl16(pb);
5858 t2 = avio_rl16(pb);
5959 nb_comments = avio_r8(pb);
60− flags = avio_r8(pb);
60+ avio_skip(pb, 1); /* flags */
6161 avio_skip(pb, 4);
6262 GET_SAUCE_META("encoder", 22);
6363
libavformat/sol.c+1−2
@@ -85,7 +85,6 @@ static int sol_channels(int magic, int type) · 84 unmodified lines
8585 static int sol_read_header(AVFormatContext *s,
8686 AVFormatParameters *ap)
8787 {
88− int size av_unused;
8988 unsigned int magic,tag;
9089 AVIOContext *pb = s->pb;
9190 unsigned int id, channels, rate, type;
@@ -99,7 +98,7 @@ static int sol_read_header(AVFormatContext *s, · 7 unmodified lines
9998 return -1;
10099 rate = avio_rl16(pb);
101100 type = avio_r8(pb);
102− size = avio_rl32(pb);
101+ avio_skip(pb, 4); /* size */
103102 if (magic != 0x0B8D)
104103 avio_r8(pb); /* newer SOLs contain padding byte */
105104
tests/fate/h264.mak+102−102
@@ -179,23 +179,23 @@ FATE_H264 := $(FATE_H264:%=fate-h264-conformance-%) \ · 178 unmodified lines
179179 FATE_TESTS += $(FATE_H264)
180180 fate-h264: $(FATE_H264)
181181
182−fate-h264-conformance-aud_mw_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/AUD_MW_E.264
183−fate-h264-conformance-ba1_ft_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/BA1_FT_C.264
184−fate-h264-conformance-ba1_sony_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/BA1_Sony_D.jsv
185−fate-h264-conformance-ba2_sony_f: CMD = framecrc -i $(SAMPLES)/h264-conformance/BA2_Sony_F.jsv
182+fate-h264-conformance-aud_mw_e: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/AUD_MW_E.264
183+fate-h264-conformance-ba1_ft_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/BA1_FT_C.264
184+fate-h264-conformance-ba1_sony_d: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/BA1_Sony_D.jsv
185+fate-h264-conformance-ba2_sony_f: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/BA2_Sony_F.jsv
186186 fate-h264-conformance-ba3_sva_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/BA3_SVA_C.264
187−fate-h264-conformance-ba_mw_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/BA_MW_D.264
188−fate-h264-conformance-bamq1_jvc_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/BAMQ1_JVC_C.264
189−fate-h264-conformance-bamq2_jvc_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/BAMQ2_JVC_C.264
190−fate-h264-conformance-banm_mw_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/BANM_MW_D.264
191−fate-h264-conformance-basqp1_sony_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/BASQP1_Sony_C.jsv
192−fate-h264-conformance-caba1_sony_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/CABA1_Sony_D.jsv
193−fate-h264-conformance-caba1_sva_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/CABA1_SVA_B.264
194−fate-h264-conformance-caba2_sony_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/CABA2_Sony_E.jsv
195−fate-h264-conformance-caba2_sva_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/CABA2_SVA_B.264
187+fate-h264-conformance-ba_mw_d: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/BA_MW_D.264
188+fate-h264-conformance-bamq1_jvc_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/BAMQ1_JVC_C.264
189+fate-h264-conformance-bamq2_jvc_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/BAMQ2_JVC_C.264
190+fate-h264-conformance-banm_mw_d: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/BANM_MW_D.264
191+fate-h264-conformance-basqp1_sony_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/BASQP1_Sony_C.jsv
192+fate-h264-conformance-caba1_sony_d: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CABA1_Sony_D.jsv
193+fate-h264-conformance-caba1_sva_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CABA1_SVA_B.264
194+fate-h264-conformance-caba2_sony_e: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CABA2_Sony_E.jsv
195+fate-h264-conformance-caba2_sva_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CABA2_SVA_B.264
196196 fate-h264-conformance-caba3_sony_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CABA3_Sony_C.jsv
197197 fate-h264-conformance-caba3_sva_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CABA3_SVA_B.264
198−fate-h264-conformance-caba3_toshiba_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/CABA3_TOSHIBA_E.264
198+fate-h264-conformance-caba3_toshiba_e: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CABA3_TOSHIBA_E.264
199199 fate-h264-conformance-cabac_mot_fld0_full: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/camp_mot_fld0_full.26l
200200 fate-h264-conformance-cabac_mot_frm0_full: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/camp_mot_frm0_full.26l
201201 fate-h264-conformance-cabac_mot_mbaff0_full: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/camp_mot_mbaff0_full.26l
@@ -206,7 +206,7 @@ fate-h264-conformance-cabastbr3_sony_b: CMD = framecrc -vsync 0 -strict 1 -i $( · 4 unmodified lines
206206 fate-h264-conformance-cabref3_sand_d: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CABREF3_Sand_D.264
207207 fate-h264-conformance-cacqp3_sony_d: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CACQP3_Sony_D.jsv
208208 fate-h264-conformance-cafi1_sva_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAFI1_SVA_C.264
209−fate-h264-conformance-cama1_sony_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/CAMA1_Sony_C.jsv
209+fate-h264-conformance-cama1_sony_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CAMA1_Sony_C.jsv
210210 fate-h264-conformance-cama1_toshiba_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAMA1_TOSHIBA_B.264
211211 fate-h264-conformance-cama1_vtc_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/cama1_vtc_c.avc
212212 fate-h264-conformance-cama2_vtc_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/cama2_vtc_b.avc
@@ -219,37 +219,37 @@ fate-h264-conformance-camanl3_sand_e: CMD = framecrc -vsync 0 -strict 1 -i $(SA · 6 unmodified lines
219219 fate-h264-conformance-camasl3_sony_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAMASL3_Sony_B.jsv
220220 fate-h264-conformance-camp_mot_mbaff_l30: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAMP_MOT_MBAFF_L30.26l
221221 fate-h264-conformance-camp_mot_mbaff_l31: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAMP_MOT_MBAFF_L31.26l
222−fate-h264-conformance-canl1_sony_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/CANL1_Sony_E.jsv
223−fate-h264-conformance-canl1_sva_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/CANL1_SVA_B.264
224−fate-h264-conformance-canl1_toshiba_g: CMD = framecrc -i $(SAMPLES)/h264-conformance/CANL1_TOSHIBA_G.264
225−fate-h264-conformance-canl2_sony_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/CANL2_Sony_E.jsv
226−fate-h264-conformance-canl2_sva_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/CANL2_SVA_B.264
222+fate-h264-conformance-canl1_sony_e: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CANL1_Sony_E.jsv
223+fate-h264-conformance-canl1_sva_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CANL1_SVA_B.264
224+fate-h264-conformance-canl1_toshiba_g: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CANL1_TOSHIBA_G.264
225+fate-h264-conformance-canl2_sony_e: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CANL2_Sony_E.jsv
226+fate-h264-conformance-canl2_sva_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CANL2_SVA_B.264
227227 fate-h264-conformance-canl3_sony_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CANL3_Sony_C.jsv
228−fate-h264-conformance-canl3_sva_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/CANL3_SVA_B.264
229−fate-h264-conformance-canl4_sva_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/CANL4_SVA_B.264
230−fate-h264-conformance-canlma2_sony_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/CANLMA2_Sony_C.jsv
231−fate-h264-conformance-canlma3_sony_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/CANLMA3_Sony_C.jsv
228+fate-h264-conformance-canl3_sva_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CANL3_SVA_B.264
229+fate-h264-conformance-canl4_sva_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CANL4_SVA_B.264
230+fate-h264-conformance-canlma2_sony_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CANLMA2_Sony_C.jsv
231+fate-h264-conformance-canlma3_sony_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CANLMA3_Sony_C.jsv
232232 fate-h264-conformance-capa1_toshiba_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAPA1_TOSHIBA_B.264
233233 fate-h264-conformance-capama3_sand_f: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAPAMA3_Sand_F.264
234−fate-h264-conformance-capcm1_sand_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/CAPCM1_Sand_E.264
235−fate-h264-conformance-capcmnl1_sand_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/CAPCMNL1_Sand_E.264
234+fate-h264-conformance-capcm1_sand_e: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CAPCM1_Sand_E.264
235+fate-h264-conformance-capcmnl1_sand_e: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CAPCMNL1_Sand_E.264
236236 fate-h264-conformance-capm3_sony_d: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAPM3_Sony_D.jsv
237−fate-h264-conformance-caqp1_sony_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/CAQP1_Sony_B.jsv
237+fate-h264-conformance-caqp1_sony_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CAQP1_Sony_B.jsv
238238 fate-h264-conformance-cavlc_mot_fld0_full_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/cvmp_mot_fld0_full_B.26l
239239 fate-h264-conformance-cavlc_mot_frm0_full_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/cvmp_mot_frm0_full_B.26l
240240 fate-h264-conformance-cavlc_mot_mbaff0_full_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/cvmp_mot_mbaff0_full_B.26l
241241 fate-h264-conformance-cavlc_mot_picaff0_full_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/cvmp_mot_picaff0_full_B.26l
242−fate-h264-conformance-cawp1_toshiba_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/CAWP1_TOSHIBA_E.264
242+fate-h264-conformance-cawp1_toshiba_e: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CAWP1_TOSHIBA_E.264
243243 fate-h264-conformance-cawp5_toshiba_e: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAWP5_TOSHIBA_E.264
244−fate-h264-conformance-ci1_ft_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/CI1_FT_B.264
245−fate-h264-conformance-ci_mw_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/CI_MW_D.264
244+fate-h264-conformance-ci1_ft_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CI1_FT_B.264
245+fate-h264-conformance-ci_mw_d: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CI_MW_D.264
246246 fate-h264-conformance-cvbs3_sony_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVBS3_Sony_C.jsv
247−fate-h264-conformance-cvcanlma2_sony_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/CVCANLMA2_Sony_C.jsv
247+fate-h264-conformance-cvcanlma2_sony_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CVCANLMA2_Sony_C.jsv
248248 fate-h264-conformance-cvfi1_sony_d: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVFI1_Sony_D.jsv
249249 fate-h264-conformance-cvfi1_sva_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVFI1_SVA_C.264
250250 fate-h264-conformance-cvfi2_sony_h: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVFI2_Sony_H.jsv
251251 fate-h264-conformance-cvfi2_sva_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVFI2_SVA_C.264
252−fate-h264-conformance-cvma1_sony_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/CVMA1_Sony_D.jsv
252+fate-h264-conformance-cvma1_sony_d: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CVMA1_Sony_D.jsv
253253 fate-h264-conformance-cvma1_toshiba_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVMA1_TOSHIBA_B.264
254254 fate-h264-conformance-cvmanl1_toshiba_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVMANL1_TOSHIBA_B.264
255255 fate-h264-conformance-cvmanl2_toshiba_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVMANL2_TOSHIBA_B.264
@@ -261,68 +261,68 @@ fate-h264-conformance-cvmp_mot_frm_l31_b: CMD = framecrc -vsync 0 -strict 1 -i · 5 unmodified lines
261261 fate-h264-conformance-cvnlfi1_sony_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CVNLFI1_Sony_C.jsv
262262 fate-h264-conformance-cvnlfi2_sony_h: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVNLFI2_Sony_H.jsv
263263 fate-h264-conformance-cvpa1_toshiba_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVPA1_TOSHIBA_B.264
264−fate-h264-conformance-cvpcmnl1_sva_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/CVPCMNL1_SVA_C.264
265−fate-h264-conformance-cvpcmnl2_sva_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/CVPCMNL2_SVA_C.264
266−fate-h264-conformance-cvwp1_toshiba_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/CVWP1_TOSHIBA_E.264
264+fate-h264-conformance-cvpcmnl1_sva_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CVPCMNL1_SVA_C.264
265+fate-h264-conformance-cvpcmnl2_sva_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CVPCMNL2_SVA_C.264
266+fate-h264-conformance-cvwp1_toshiba_e: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CVWP1_TOSHIBA_E.264
267267 fate-h264-conformance-cvwp2_toshiba_e: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVWP2_TOSHIBA_E.264
268268 fate-h264-conformance-cvwp3_toshiba_e: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVWP3_TOSHIBA_E.264
269269 fate-h264-conformance-cvwp5_toshiba_e: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVWP5_TOSHIBA_E.264
270270 fate-h264-conformance-fi1_sony_e: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FI1_Sony_E.jsv
271−fate-h264-conformance-frext-alphaconformanceg: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/test8b43.264
272−fate-h264-conformance-frext-bcrm_freh10: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/freh10.264 -vsync 0
273−fate-h264-conformance-frext-brcm_freh11: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/freh11.264 -vsync 0
274−fate-h264-conformance-frext-brcm_freh3: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/freh3.264
275−fate-h264-conformance-frext-brcm_freh4: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/freh4.264 -vsync 0
276−fate-h264-conformance-frext-brcm_freh5: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/freh5.264
277−fate-h264-conformance-frext-brcm_freh8: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/freh8.264
278−fate-h264-conformance-frext-brcm_freh9: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/freh9.264
279−fate-h264-conformance-frext-freh12_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/Freh12_B.264
280−fate-h264-conformance-frext-freh1_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/Freh1_B.264
281−fate-h264-conformance-frext-freh2_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/Freh2_B.264
282−fate-h264-conformance-frext-freh6: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/freh6.264 -vsync 0
283−fate-h264-conformance-frext-freh7_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/Freh7_B.264 -vsync 0
284−fate-h264-conformance-frext-frext01_jvc_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/FREXT01_JVC_D.264
285−fate-h264-conformance-frext-frext02_jvc_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/FREXT02_JVC_C.264
286−fate-h264-conformance-frext-frext1_panasonic_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/FRExt1_Panasonic.avc
287−fate-h264-conformance-frext-frext2_panasonic_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/FRExt2_Panasonic.avc -vsync 0
288−fate-h264-conformance-frext-frext3_panasonic_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/FRExt3_Panasonic.avc
289−fate-h264-conformance-frext-frext4_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/FRExt4_Panasonic.avc
271+fate-h264-conformance-frext-alphaconformanceg: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/test8b43.264
272+fate-h264-conformance-frext-bcrm_freh10: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/freh10.264 -vsync 0
273+fate-h264-conformance-frext-brcm_freh11: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/freh11.264 -vsync 0
274+fate-h264-conformance-frext-brcm_freh3: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/freh3.264
275+fate-h264-conformance-frext-brcm_freh4: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/freh4.264 -vsync 0
276+fate-h264-conformance-frext-brcm_freh5: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/freh5.264
277+fate-h264-conformance-frext-brcm_freh8: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/freh8.264
278+fate-h264-conformance-frext-brcm_freh9: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/freh9.264
279+fate-h264-conformance-frext-freh12_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/Freh12_B.264
280+fate-h264-conformance-frext-freh1_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/Freh1_B.264
281+fate-h264-conformance-frext-freh2_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/Freh2_B.264
282+fate-h264-conformance-frext-freh6: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/freh6.264 -vsync 0
283+fate-h264-conformance-frext-freh7_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/Freh7_B.264 -vsync 0
284+fate-h264-conformance-frext-frext01_jvc_d: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/FREXT01_JVC_D.264
285+fate-h264-conformance-frext-frext02_jvc_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/FREXT02_JVC_C.264
286+fate-h264-conformance-frext-frext1_panasonic_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/FRExt1_Panasonic.avc
287+fate-h264-conformance-frext-frext2_panasonic_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/FRExt2_Panasonic.avc -vsync 0
288+fate-h264-conformance-frext-frext3_panasonic_d: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/FRExt3_Panasonic.avc
289+fate-h264-conformance-frext-frext4_panasonic_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/FRExt4_Panasonic.avc
290290 fate-h264-conformance-frext-frext_mmco4_sony_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/FRExt_MMCO4_Sony_B.264
291−fate-h264-conformance-frext-hcaff1_hhi_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HCAFF1_HHI.264
292−fate-h264-conformance-frext-hcafr1_hhi_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HCAFR1_HHI.264
293−fate-h264-conformance-frext-hcafr2_hhi_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HCAFR2_HHI.264
294−fate-h264-conformance-frext-hcafr3_hhi_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HCAFR3_HHI.264
295−fate-h264-conformance-frext-hcafr4_hhi_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HCAFR4_HHI.264
296−fate-h264-conformance-frext-hcamff1_hhi_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HCAMFF1_HHI.264
297−fate-h264-conformance-frext-hpca_brcm_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCA_BRCM_C.264
298−fate-h264-conformance-frext-hpcadq_brcm_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCADQ_BRCM_B.264
299−fate-h264-conformance-frext-hpcafl_bcrm_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCAFL_BRCM_C.264 -vsync 0
300−fate-h264-conformance-frext-hpcaflnl_bcrm_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCAFLNL_BRCM_C.264 -vsync 0
301−fate-h264-conformance-frext-hpcalq_brcm_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCALQ_BRCM_B.264
302−fate-h264-conformance-frext-hpcamapalq_bcrm_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCAMAPALQ_BRCM_B.264 -vsync 0
303−fate-h264-conformance-frext-hpcamolq_brcm_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCAMOLQ_BRCM_B.264
304−fate-h264-conformance-frext-hpcanl_brcm_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCANL_BRCM_C.264
305−fate-h264-conformance-frext-hpcaq2lq_brcm_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCAQ2LQ_BRCM_B.264
306−fate-h264-conformance-frext-hpcv_brcm_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCV_BRCM_A.264
307−fate-h264-conformance-frext-hpcvfl_bcrm_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCVFL_BRCM_A.264 -vsync 0
308−fate-h264-conformance-frext-hpcvflnl_bcrm_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCVFLNL_BRCM_A.264 -vsync 0
309−fate-h264-conformance-frext-hpcvmolq_brcm_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCVMOLQ_BRCM_B.264
310−fate-h264-conformance-frext-hpcvnl_brcm_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCVNL_BRCM_A.264
311−fate-h264-conformance-frext-pph10i1_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/PPH10I1_Panasonic_A.264 -pix_fmt yuv420p10le
312−fate-h264-conformance-frext-pph10i2_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/PPH10I2_Panasonic_A.264 -pix_fmt yuv420p10le
313−fate-h264-conformance-frext-pph10i3_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/PPH10I3_Panasonic_A.264 -pix_fmt yuv420p10le
314−fate-h264-conformance-frext-pph10i4_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/PPH10I4_Panasonic_A.264 -pix_fmt yuv420p10le
315−fate-h264-conformance-frext-pph10i5_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/PPH10I5_Panasonic_A.264 -pix_fmt yuv420p10le
316−fate-h264-conformance-frext-pph10i6_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/PPH10I6_Panasonic_A.264 -pix_fmt yuv420p10le
317−fate-h264-conformance-frext-pph10i7_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/PPH10I7_Panasonic_A.264 -pix_fmt yuv420p10le
291+fate-h264-conformance-frext-hcaff1_hhi_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/HCAFF1_HHI.264
292+fate-h264-conformance-frext-hcafr1_hhi_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/HCAFR1_HHI.264
293+fate-h264-conformance-frext-hcafr2_hhi_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/HCAFR2_HHI.264
294+fate-h264-conformance-frext-hcafr3_hhi_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/HCAFR3_HHI.264
295+fate-h264-conformance-frext-hcafr4_hhi_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/HCAFR4_HHI.264
296+fate-h264-conformance-frext-hcamff1_hhi_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/HCAMFF1_HHI.264
297+fate-h264-conformance-frext-hpca_brcm_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/HPCA_BRCM_C.264
298+fate-h264-conformance-frext-hpcadq_brcm_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/HPCADQ_BRCM_B.264
299+fate-h264-conformance-frext-hpcafl_bcrm_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/HPCAFL_BRCM_C.264 -vsync 0
300+fate-h264-conformance-frext-hpcaflnl_bcrm_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/HPCAFLNL_BRCM_C.264 -vsync 0
301+fate-h264-conformance-frext-hpcalq_brcm_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/HPCALQ_BRCM_B.264
302+fate-h264-conformance-frext-hpcamapalq_bcrm_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/HPCAMAPALQ_BRCM_B.264 -vsync 0
303+fate-h264-conformance-frext-hpcamolq_brcm_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/HPCAMOLQ_BRCM_B.264
304+fate-h264-conformance-frext-hpcanl_brcm_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/HPCANL_BRCM_C.264
305+fate-h264-conformance-frext-hpcaq2lq_brcm_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/HPCAQ2LQ_BRCM_B.264
306+fate-h264-conformance-frext-hpcv_brcm_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/HPCV_BRCM_A.264
307+fate-h264-conformance-frext-hpcvfl_bcrm_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/HPCVFL_BRCM_A.264 -vsync 0
308+fate-h264-conformance-frext-hpcvflnl_bcrm_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/HPCVFLNL_BRCM_A.264 -vsync 0
309+fate-h264-conformance-frext-hpcvmolq_brcm_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/HPCVMOLQ_BRCM_B.264
310+fate-h264-conformance-frext-hpcvnl_brcm_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/HPCVNL_BRCM_A.264
311+fate-h264-conformance-frext-pph10i1_panasonic_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/PPH10I1_Panasonic_A.264 -pix_fmt yuv420p10le
312+fate-h264-conformance-frext-pph10i2_panasonic_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/PPH10I2_Panasonic_A.264 -pix_fmt yuv420p10le
313+fate-h264-conformance-frext-pph10i3_panasonic_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/PPH10I3_Panasonic_A.264 -pix_fmt yuv420p10le
314+fate-h264-conformance-frext-pph10i4_panasonic_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/PPH10I4_Panasonic_A.264 -pix_fmt yuv420p10le
315+fate-h264-conformance-frext-pph10i5_panasonic_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/PPH10I5_Panasonic_A.264 -pix_fmt yuv420p10le
316+fate-h264-conformance-frext-pph10i6_panasonic_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/PPH10I6_Panasonic_A.264 -pix_fmt yuv420p10le
317+fate-h264-conformance-frext-pph10i7_panasonic_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/FRext/PPH10I7_Panasonic_A.264 -pix_fmt yuv420p10le
318318 fate-h264-conformance-hcbp2_hhi_a: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/HCBP2_HHI_A.264
319319 fate-h264-conformance-hcmp1_hhi_a: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/HCMP1_HHI_A.264
320−fate-h264-conformance-ls_sva_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/LS_SVA_D.264
321−fate-h264-conformance-midr_mw_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/MIDR_MW_D.264
322−fate-h264-conformance-mps_mw_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/MPS_MW_A.264
323−fate-h264-conformance-mr1_bt_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/MR1_BT_A.h264
324−fate-h264-conformance-mr1_mw_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/MR1_MW_A.264
325−fate-h264-conformance-mr2_mw_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/MR2_MW_A.264
320+fate-h264-conformance-ls_sva_d: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/LS_SVA_D.264
321+fate-h264-conformance-midr_mw_d: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/MIDR_MW_D.264
322+fate-h264-conformance-mps_mw_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/MPS_MW_A.264
323+fate-h264-conformance-mr1_bt_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/MR1_BT_A.h264
324+fate-h264-conformance-mr1_mw_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/MR1_MW_A.264
325+fate-h264-conformance-mr2_mw_a: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/MR2_MW_A.264
326326 fate-h264-conformance-mr2_tandberg_e: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR2_TANDBERG_E.264
327327 fate-h264-conformance-mr3_tandberg_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR3_TANDBERG_B.264
328328 fate-h264-conformance-mr4_tandberg_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR4_TANDBERG_C.264
@@ -332,26 +332,26 @@ fate-h264-conformance-mr7_bt_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES) · 3 unmodified lines
332332 fate-h264-conformance-mr8_bt_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR8_BT_B.h264
333333 fate-h264-conformance-mr9_bt_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR9_BT_B.h264
334334 fate-h264-conformance-mv1_brcm_d: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/src19td.IBP.264
335−fate-h264-conformance-nl1_sony_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/NL1_Sony_D.jsv
336−fate-h264-conformance-nl2_sony_h: CMD = framecrc -i $(SAMPLES)/h264-conformance/NL2_Sony_H.jsv
337−fate-h264-conformance-nl3_sva_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/NL3_SVA_E.264
338−fate-h264-conformance-nlmq1_jvc_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/NLMQ1_JVC_C.264
339−fate-h264-conformance-nlmq2_jvc_c: CMD = framecrc -i $(SAMPLES)/h264-conformance/NLMQ2_JVC_C.264
340−fate-h264-conformance-nrf_mw_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/NRF_MW_E.264
335+fate-h264-conformance-nl1_sony_d: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/NL1_Sony_D.jsv
336+fate-h264-conformance-nl2_sony_h: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/NL2_Sony_H.jsv
337+fate-h264-conformance-nl3_sva_e: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/NL3_SVA_E.264
338+fate-h264-conformance-nlmq1_jvc_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/NLMQ1_JVC_C.264
339+fate-h264-conformance-nlmq2_jvc_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/NLMQ2_JVC_C.264
340+fate-h264-conformance-nrf_mw_e: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/NRF_MW_E.264
341341 fate-h264-conformance-sharp_mp_field_1_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/Sharp_MP_Field_1_B.jvt
342342 fate-h264-conformance-sharp_mp_field_2_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/Sharp_MP_Field_2_B.jvt
343343 fate-h264-conformance-sharp_mp_field_3_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/Sharp_MP_Field_3_B.jvt
344344 fate-h264-conformance-sharp_mp_paff_1r2: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/Sharp_MP_PAFF_1r2.jvt
345345 fate-h264-conformance-sharp_mp_paff_2r: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/Sharp_MP_PAFF_2.jvt
346346 fate-h264-conformance-sl1_sva_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/SL1_SVA_B.264
347−fate-h264-conformance-sva_ba1_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/SVA_BA1_B.264
348−fate-h264-conformance-sva_ba2_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/SVA_BA2_D.264
349−fate-h264-conformance-sva_base_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/SVA_Base_B.264
350−fate-h264-conformance-sva_cl1_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/SVA_CL1_E.264
351−fate-h264-conformance-sva_fm1_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/SVA_FM1_E.264
352−fate-h264-conformance-sva_nl1_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/SVA_NL1_B.264
353−fate-h264-conformance-sva_nl2_e: CMD = framecrc -i $(SAMPLES)/h264-conformance/SVA_NL2_E.264
347+fate-h264-conformance-sva_ba1_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/SVA_BA1_B.264
348+fate-h264-conformance-sva_ba2_d: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/SVA_BA2_D.264
349+fate-h264-conformance-sva_base_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/SVA_Base_B.264
350+fate-h264-conformance-sva_cl1_e: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/SVA_CL1_E.264
351+fate-h264-conformance-sva_fm1_e: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/SVA_FM1_E.264
352+fate-h264-conformance-sva_nl1_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/SVA_NL1_B.264
353+fate-h264-conformance-sva_nl2_e: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/SVA_NL2_E.264
354354
355−fate-h264-interlace-crop: CMD = framecrc -vframes 3 -i $(SAMPLES)/h264/interlaced_crop.mp4
356−fate-h264-lossless: CMD = framecrc -i $(SAMPLES)/h264/lossless.h264
355+fate-h264-interlace-crop: CMD = framecrc -vsync 0 -vframes 3 -i $(SAMPLES)/h264/interlaced_crop.mp4
356+fate-h264-lossless: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264/lossless.h264
357357 fate-h264-extreme-plane-pred: CMD = framemd5 -strict 1 -vsync 0 -i $(SAMPLES)/h264/extreme-plane-pred.h264
tests/regression-funcs.sh+1−1
@@ -102,7 +102,7 @@ do_ffmpeg_crc() · 101 unmodified lines
102102
103103 do_video_decoding()
104104 {
105− do_ffmpeg $raw_dst $DEC_OPTS $1 -i $target_path/$file -f rawvideo $ENC_OPTS $2
105+ do_ffmpeg $raw_dst $DEC_OPTS $1 -i $target_path/$file -f rawvideo $ENC_OPTS -vsync 0 $2
106106 }
107107
108108 do_video_encoding()

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t