* 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
Unified · Split
| @@ -1077,6 +1077,8 @@ HAVE_LIST=" · 1076 unmodified lines | ||
| 1077 | 1077 | isatty |
| 1078 | 1078 | kbhit |
| 1079 | 1079 | ldbrx |
| 1080 | + libdc1394_1 | |
| 1081 | + libdc1394_2 | |
| 1080 | 1082 | llrint |
| 1081 | 1083 | llrintf |
| 1082 | 1084 | local_aligned_16 |
| @@ -2914,7 +2916,6 @@ check_mathfunc truncf · 1831 unmodified lines | ||
| 2914 | 2916 | enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lavifil32 |
| 2915 | 2917 | enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 |
| 2916 | 2918 | 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 | |
| 2918 | 2919 | enabled libdirac && require_pkg_config dirac \ |
| 2919 | 2920 | "libdirac_decoder/dirac_parser.h libdirac_encoder/dirac_encoder.h" \ |
| 2920 | 2921 | "dirac_decoder_init dirac_encoder_init" |
| @@ -2946,6 +2947,15 @@ enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs · 25 unmodified lines | ||
| 2946 | 2947 | enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore |
| 2947 | 2948 | enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib |
| 2948 | 2949 | |
| 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 | + | |
| 2949 | 2959 | SDL_CONFIG="${cross_prefix}sdl-config" |
| 2950 | 2960 | if check_pkg_config sdl SDL_version.h SDL_Linked_Version; then |
| 2951 | 2961 | check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags && |
| @@ -1242,7 +1242,7 @@ static void do_video_out(AVFormatContext *s, · 1241 unmodified lines | ||
| 1242 | 1242 | } |
| 1243 | 1243 | } |
| 1244 | 1244 | 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); | |
| 1246 | 1246 | } |
| 1247 | 1247 | #endif |
| 1248 | 1248 | |
| @@ -3723,7 +3723,6 @@ static void new_audio_stream(AVFormatContext *oc, int file_idx) · 2474 unmodified lines | ||
| 3723 | 3723 | static void new_data_stream(AVFormatContext *oc, int file_idx) |
| 3724 | 3724 | { |
| 3725 | 3725 | AVStream *st; |
| 3726 | − AVOutputStream *ost av_unused; | |
| 3727 | 3726 | AVCodec *codec=NULL; |
| 3728 | 3727 | AVCodecContext *data_enc; |
| 3729 | 3728 | |
| @@ -3732,7 +3731,7 @@ static void new_data_stream(AVFormatContext *oc, int file_idx) · 2 unmodified lines | ||
| 3732 | 3731 | fprintf(stderr, "Could not alloc stream\n"); |
| 3733 | 3732 | ffmpeg_exit(1); |
| 3734 | 3733 | } |
| 3735 | − ost = new_output_stream(oc, file_idx); | |
| 3734 | + new_output_stream(oc, file_idx); | |
| 3736 | 3735 | data_enc = st->codec; |
| 3737 | 3736 | output_codecs = grow_array(output_codecs, sizeof(*output_codecs), &nb_output_codecs, nb_output_codecs + 1); |
| 3738 | 3737 | if (!data_stream_copy) { |
| @@ -1760,7 +1760,7 @@ static int http_parse_request(HTTPContext *c) · 1759 unmodified lines | ||
| 1760 | 1760 | } |
| 1761 | 1761 | } |
| 1762 | 1762 | |
| 1763 | −#ifdef DEBUG_WMP | |
| 1763 | +#ifdef DEBUG | |
| 1764 | 1764 | http_log("\nGot request:\n%s\n", c->buffer); |
| 1765 | 1765 | #endif |
| 1766 | 1766 | |
| @@ -1790,7 +1790,7 @@ static int http_parse_request(HTTPContext *c) · 23 unmodified lines | ||
| 1790 | 1790 | return 0; |
| 1791 | 1791 | } |
| 1792 | 1792 | |
| 1793 | −#ifdef DEBUG_WMP | |
| 1793 | +#ifdef DEBUG | |
| 1794 | 1794 | if (strcmp(stream->filename + strlen(stream->filename) - 4, ".asf") == 0) |
| 1795 | 1795 | http_log("\nGot request:\n%s\n", c->buffer); |
| 1796 | 1796 | #endif |
| @@ -312,7 +312,7 @@ static void encode_window_bands_info(AACEncContext *s, SingleChannelElement *sce · 311 unmodified lines | ||
| 312 | 312 | int win, int group_len, const float lambda) |
| 313 | 313 | { |
| 314 | 314 | BandCodingPath path[120][12]; |
| 315 | − int w, swb, cb, start, start2, size; | |
| 315 | + int w, swb, cb, start, size; | |
| 316 | 316 | int i, j; |
| 317 | 317 | const int max_sfb = sce->ics.max_sfb; |
| 318 | 318 | 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 | ||
| 330 | 330 | path[0][cb].run = 0; |
| 331 | 331 | } |
| 332 | 332 | for (swb = 0; swb < max_sfb; swb++) { |
| 333 | − start2 = start; | |
| 334 | 333 | size = sce->ics.swb_sizes[swb]; |
| 335 | 334 | if (sce->zeroes[win*16 + swb]) { |
| 336 | 335 | for (cb = 0; cb < 12; cb++) { |
| @@ -414,7 +413,7 @@ static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce, · 77 unmodified lines | ||
| 414 | 413 | int win, int group_len, const float lambda) |
| 415 | 414 | { |
| 416 | 415 | BandCodingPath path[120][12]; |
| 417 | − int w, swb, cb, start, start2, size; | |
| 416 | + int w, swb, cb, start, size; | |
| 418 | 417 | int i, j; |
| 419 | 418 | const int max_sfb = sce->ics.max_sfb; |
| 420 | 419 | 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 | ||
| 432 | 431 | path[0][cb].run = 0; |
| 433 | 432 | } |
| 434 | 433 | for (swb = 0; swb < max_sfb; swb++) { |
| 435 | − start2 = start; | |
| 436 | 434 | size = sce->ics.swb_sizes[swb]; |
| 437 | 435 | if (sce->zeroes[win*16 + swb]) { |
| 438 | 436 | for (cb = 0; cb < 12; cb++) { |
| @@ -1007,12 +1005,11 @@ static void search_for_quantizers_fast(AVCodecContext *avctx, AACEncContext *s, · 568 unmodified lines | ||
| 1007 | 1005 | SingleChannelElement *sce, |
| 1008 | 1006 | const float lambda) |
| 1009 | 1007 | { |
| 1010 | − int start = 0, i, w, w2, g; | |
| 1008 | + int i, w, w2, g; | |
| 1011 | 1009 | int minq = 255; |
| 1012 | 1010 | |
| 1013 | 1011 | memset(sce->sf_idx, 0, sizeof(sce->sf_idx)); |
| 1014 | 1012 | for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { |
| 1015 | − start = w*128; | |
| 1016 | 1013 | for (g = 0; g < sce->ics.num_swb; g++) { |
| 1017 | 1014 | for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { |
| 1018 | 1015 | FFPsyBand *band = &s->psy.psy_bands[s->cur_channel*PSY_MAX_BANDS+(w+w2)*16+g]; |
| @@ -30,6 +30,7 @@ · 29 unmodified lines | ||
| 30 | 30 | * add temporal noise shaping |
| 31 | 31 | ***********************************/ |
| 32 | 32 | |
| 33 | +#include "libavutil/opt.h" | |
| 33 | 34 | #include "avcodec.h" |
| 34 | 35 | #include "put_bits.h" |
| 35 | 36 | #include "dsputil.h" |
| @@ -489,7 +490,7 @@ static int aac_encode_frame(AVCodecContext *avctx, · 453 unmodified lines | ||
| 489 | 490 | AACEncContext *s = avctx->priv_data; |
| 490 | 491 | int16_t *samples = s->samples, *samples2, *la; |
| 491 | 492 | ChannelElement *cpe; |
| 492 | − int i, ch, w, chans, tag, start_ch; | |
| 493 | + int i, ch, w, g, chans, tag, start_ch; | |
| 493 | 494 | const uint8_t *chan_map = aac_chan_configs[avctx->channels-1]; |
| 494 | 495 | int chan_el_counter[4]; |
| 495 | 496 | FFPsyWindowInfo windows[AAC_MAX_CHANNELS]; |
| @@ -587,8 +588,16 @@ static int aac_encode_frame(AVCodecContext *avctx, · 91 unmodified lines | ||
| 587 | 588 | } |
| 588 | 589 | } |
| 589 | 590 | 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 | + } | |
| 592 | 601 | adjust_frame_information(s, cpe, chans); |
| 593 | 602 | if (chans == 2) { |
| 594 | 603 | put_bits(&s->pb, 1, cpe->common_window); |
| @@ -645,6 +654,22 @@ static av_cold int aac_encode_end(AVCodecContext *avctx) · 50 unmodified lines | ||
| 645 | 654 | return 0; |
| 646 | 655 | } |
| 647 | 656 | |
| 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 | + | |
| 648 | 673 | AVCodec ff_aac_encoder = { |
| 649 | 674 | "aac", |
| 650 | 675 | AVMEDIA_TYPE_AUDIO, |
| @@ -656,4 +681,5 @@ AVCodec ff_aac_encoder = { · 5 unmodified lines | ||
| 656 | 681 | .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY | CODEC_CAP_EXPERIMENTAL, |
| 657 | 682 | .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE}, |
| 658 | 683 | .long_name = NULL_IF_CONFIG_SMALL("Advanced Audio Coding"), |
| 684 | + .priv_class = &aacenc_class, | |
| 659 | 685 | }; |
| @@ -30,6 +30,10 @@ · 29 unmodified lines | ||
| 30 | 30 | |
| 31 | 31 | #include "psymodel.h" |
| 32 | 32 | |
| 33 | +typedef struct AACEncOptions { | |
| 34 | + int stereo_mode; | |
| 35 | +} AACEncOptions; | |
| 36 | + | |
| 33 | 37 | struct AACEncContext; |
| 34 | 38 | |
| 35 | 39 | typedef struct AACCoefficientsEncoder { |
| @@ -48,6 +52,8 @@ extern AACCoefficientsEncoder ff_aac_coders[]; · 12 unmodified lines | ||
| 48 | 52 | * AAC encoder context |
| 49 | 53 | */ |
| 50 | 54 | typedef struct AACEncContext { |
| 55 | + AVClass *av_class; | |
| 56 | + AACEncOptions options; ///< encoding options | |
| 51 | 57 | PutBitContext pb; |
| 52 | 58 | FFTContext mdct1024; ///< long (1024 samples) frame transform context |
| 53 | 59 | FFTContext mdct128; ///< short (128 samples) frame transform context |
| @@ -66,7 +66,6 @@ · 65 unmodified lines | ||
| 66 | 66 | |
| 67 | 67 | #define SUBBAND_SIZE 20 |
| 68 | 68 | #define MAX_SUBPACKETS 5 |
| 69 | −//#define COOKDEBUG | |
| 70 | 69 | |
| 71 | 70 | typedef struct { |
| 72 | 71 | int *now; |
| @@ -166,38 +165,6 @@ typedef struct cook { · 93 unmodified lines | ||
| 166 | 165 | static float pow2tab[127]; |
| 167 | 166 | static float rootpow2tab[127]; |
| 168 | 167 | |
| 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 | − | |
| 201 | 168 | /*************** init functions ***************/ |
| 202 | 169 | |
| 203 | 170 | /* table generator */ |
| @@ -1037,7 +1004,7 @@ static int cook_decode_frame(AVCodecContext *avctx, · 833 unmodified lines | ||
| 1037 | 1004 | return avctx->block_align; |
| 1038 | 1005 | } |
| 1039 | 1006 | |
| 1040 | −#ifdef COOKDEBUG | |
| 1007 | +#ifdef DEBUG | |
| 1041 | 1008 | static void dump_cook_context(COOKContext *q) |
| 1042 | 1009 | { |
| 1043 | 1010 | //int i=0; |
| @@ -1055,7 +1022,6 @@ static void dump_cook_context(COOKContext *q) · 11 unmodified lines | ||
| 1055 | 1022 | PRINT("samples_per_channel",q->subpacket[0].samples_per_channel); |
| 1056 | 1023 | PRINT("samples_per_frame",q->subpacket[0].samples_per_frame); |
| 1057 | 1024 | PRINT("subbands",q->subpacket[0].subbands); |
| 1058 | − PRINT("random_state",q->random_state); | |
| 1059 | 1025 | PRINT("js_subband_start",q->subpacket[0].js_subband_start); |
| 1060 | 1026 | PRINT("log2_numvector_size",q->subpacket[0].log2_numvector_size); |
| 1061 | 1027 | PRINT("numvector_size",q->subpacket[0].numvector_size); |
| @@ -1280,7 +1246,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) · 218 unmodified lines | ||
| 1280 | 1246 | else |
| 1281 | 1247 | avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO; |
| 1282 | 1248 | |
| 1283 | −#ifdef COOKDEBUG | |
| 1249 | +#ifdef DEBUG | |
| 1284 | 1250 | dump_cook_context(q); |
| 1285 | 1251 | #endif |
| 1286 | 1252 | return 0; |
| @@ -1535,8 +1535,6 @@ static void dca_exss_parse_header(DCAContext *s) · 1534 unmodified lines | ||
| 1535 | 1535 | { |
| 1536 | 1536 | int ss_index; |
| 1537 | 1537 | int blownup; |
| 1538 | − int header_size av_unused; | |
| 1539 | − int hd_size av_unused; | |
| 1540 | 1538 | int num_audiop = 1; |
| 1541 | 1539 | int num_assets = 1; |
| 1542 | 1540 | int active_ss_mask[8]; |
| @@ -1549,8 +1547,8 @@ static void dca_exss_parse_header(DCAContext *s) · 6 unmodified lines | ||
| 1549 | 1547 | ss_index = get_bits(&s->gb, 2); |
| 1550 | 1548 | |
| 1551 | 1549 | 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 | |
| 1554 | 1552 | |
| 1555 | 1553 | s->static_fields = get_bits1(&s->gb); |
| 1556 | 1554 | if (s->static_fields) { |
| @@ -245,11 +245,11 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb, · 244 unmodified lines | ||
| 245 | 245 | int ff_dirac_parse_sequence_header(AVCodecContext *avctx, GetBitContext *gb, |
| 246 | 246 | dirac_source_params *source) |
| 247 | 247 | { |
| 248 | − unsigned version_major, version_minor av_unused; | |
| 248 | + unsigned version_major; | |
| 249 | 249 | unsigned video_format, picture_coding_mode; |
| 250 | 250 | |
| 251 | 251 | version_major = svq3_get_ue_golomb(gb); |
| 252 | − version_minor = svq3_get_ue_golomb(gb); | |
| 252 | + svq3_get_ue_golomb(gb); /* version_minor */ | |
| 253 | 253 | avctx->profile = svq3_get_ue_golomb(gb); |
| 254 | 254 | avctx->level = svq3_get_ue_golomb(gb); |
| 255 | 255 | video_format = svq3_get_ue_golomb(gb); |
| @@ -32,6 +32,7 @@ · 31 unmodified lines | ||
| 32 | 32 | #include "mpegvideo.h" |
| 33 | 33 | #include "h264.h" |
| 34 | 34 | #include "rectangle.h" |
| 35 | +#include "thread.h" | |
| 35 | 36 | |
| 36 | 37 | /* |
| 37 | 38 | * 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 | ||
| 436 | 437 | int best_score=256*256*256*64; |
| 437 | 438 | int best_pred=0; |
| 438 | 439 | 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; | |
| 441 | 441 | |
| 442 | 442 | if((mb_x^mb_y^pass)&1) continue; |
| 443 | 443 | |
| @@ -535,10 +535,26 @@ skip_mean_and_median: · 91 unmodified lines | ||
| 535 | 535 | /* zero MV */ |
| 536 | 536 | pred_count++; |
| 537 | 537 | |
| 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 | + | |
| 538 | 554 | /* 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; | |
| 542 | 558 | pred_count++; |
| 543 | 559 | |
| 544 | 560 | s->mv_dir = MV_DIR_FORWARD; |
| @@ -670,6 +686,12 @@ static int is_intra_more_likely(MpegEncContext *s){ · 125 unmodified lines | ||
| 670 | 686 | uint8_t *mb_ptr = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize; |
| 671 | 687 | uint8_t *last_mb_ptr= s->last_picture.data [0] + mb_x*16 + mb_y*16*s->linesize; |
| 672 | 688 | |
| 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 | + } | |
| 673 | 695 | is_intra_likely += s->dsp.sad[0](NULL, last_mb_ptr, mb_ptr , s->linesize, 16); |
| 674 | 696 | // FIXME need await_progress() here |
| 675 | 697 | 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 | ||
| 690 | 712 | |
| 691 | 713 | 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)); |
| 692 | 714 | s->error_count= 3*s->mb_num; |
| 715 | + s->error_occurred = 0; | |
| 693 | 716 | } |
| 694 | 717 | |
| 695 | 718 | /** |
| @@ -729,7 +752,10 @@ void ff_er_add_slice(MpegEncContext *s, int startx, int starty, int endx, int en · 33 unmodified lines | ||
| 729 | 752 | s->error_count -= end_i - start_i + 1; |
| 730 | 753 | } |
| 731 | 754 | |
| 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 | + } | |
| 733 | 759 | |
| 734 | 760 | if(mask == ~0x7F){ |
| 735 | 761 | 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 | ||
| 1009 | 1035 | int time_pp= s->pp_time; |
| 1010 | 1036 | int time_pb= s->pb_time; |
| 1011 | 1037 | |
| 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 | + } | |
| 1013 | 1044 | s->mv[0][0][0] = s->next_picture.motion_val[0][xy][0]*time_pb/time_pp; |
| 1014 | 1045 | s->mv[0][0][1] = s->next_picture.motion_val[0][xy][1]*time_pb/time_pp; |
| 1015 | 1046 | s->mv[1][0][0] = s->next_picture.motion_val[0][xy][0]*(time_pb - time_pp)/time_pp; |
| @@ -656,8 +656,11 @@ retry: · 655 unmodified lines | ||
| 656 | 656 | 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) |
| 657 | 657 | break; |
| 658 | 658 | }else{ |
| 659 | + int prev_x=s->mb_x, prev_y=s->mb_y; | |
| 659 | 660 | if(ff_h263_resync(s)<0) |
| 660 | 661 | break; |
| 662 | + if (prev_y * s->mb_width + prev_x < s->mb_y * s->mb_width + s->mb_x) | |
| 663 | + s->error_occurred = 1; | |
| 661 | 664 | } |
| 662 | 665 | |
| 663 | 666 | if(s->msmpeg4_version<4 && s->h263_pred) |
| @@ -246,6 +246,141 @@ static int ff_h264_decode_rbsp_trailing(H264Context *h, const uint8_t *src){ · 245 unmodified lines | ||
| 246 | 246 | return 0; |
| 247 | 247 | } |
| 248 | 248 | |
| 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 | + | |
| 249 | 384 | #if 0 |
| 250 | 385 | /** |
| 251 | 386 | * DCT transforms the 16 dc values. |
| @@ -315,6 +450,7 @@ static void chroma_dc_dct_c(DCTELEM *block){ · 63 unmodified lines | ||
| 315 | 450 | static void free_tables(H264Context *h, int free_rbsp){ |
| 316 | 451 | int i; |
| 317 | 452 | H264Context *hx; |
| 453 | + | |
| 318 | 454 | av_freep(&h->intra4x4_pred_mode); |
| 319 | 455 | av_freep(&h->chroma_pred_mode_table); |
| 320 | 456 | av_freep(&h->cbp_table); |
| @@ -611,6 +747,7 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx){ · 290 unmodified lines | ||
| 611 | 747 | return 0; |
| 612 | 748 | } |
| 613 | 749 | |
| 750 | + | |
| 614 | 751 | #define IN_RANGE(a, b, size) (((a) >= (b)) && ((a) < ((b)+(size)))) |
| 615 | 752 | static void copy_picture_range(Picture **to, Picture **from, int count, MpegEncContext *new_base, MpegEncContext *old_base) |
| 616 | 753 | { |
| @@ -711,7 +848,8 @@ static int decode_update_thread_context(AVCodecContext *dst, const AVCodecContex · 94 unmodified lines | ||
| 711 | 848 | copy_fields(h, h1, poc_lsb, redundant_pic_count); |
| 712 | 849 | |
| 713 | 850 | //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); | |
| 715 | 853 | copy_fields(h, h1, short_ref, cabac_init_idc); |
| 716 | 854 | |
| 717 | 855 | 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 | ||
| 738 | 876 | MpegEncContext * const s = &h->s; |
| 739 | 877 | int i; |
| 740 | 878 | const int pixel_shift = h->pixel_shift; |
| 879 | + int thread_count = (s->avctx->active_thread_type & FF_THREAD_SLICE) ? s->avctx->thread_count : 1; | |
| 741 | 880 | |
| 742 | 881 | if(MPV_frame_start(s, s->avctx) < 0) |
| 743 | 882 | return -1; |
| @@ -766,7 +905,7 @@ int ff_h264_frame_start(H264Context *h){ · 22 unmodified lines | ||
| 766 | 905 | |
| 767 | 906 | /* can't be in alloc_tables because linesize isn't known there. |
| 768 | 907 | * 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++) | |
| 770 | 909 | if(h->thread_context[i] && !h->thread_context[i]->s.obmc_scratchpad) |
| 771 | 910 | h->thread_context[i]->s.obmc_scratchpad = av_malloc(16*2*s->linesize + 8*2*s->uvlinesize); |
| 772 | 911 | |
| @@ -2910,12 +3049,6 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){ · 2137 unmodified lines | ||
| 2910 | 3049 | int nal_index; |
| 2911 | 3050 | |
| 2912 | 3051 | 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 | |
| 2919 | 3052 | if(!(s->flags2 & CODEC_FLAG2_CHUNKS)){ |
| 2920 | 3053 | h->current_slice = 0; |
| 2921 | 3054 | if (!s->first_field) |
| @@ -3491,8 +3624,7 @@ AVCodec ff_h264_decoder = { · 569 unmodified lines | ||
| 3491 | 3624 | ff_h264_decode_end, |
| 3492 | 3625 | decode_frame, |
| 3493 | 3626 | /*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, | |
| 3496 | 3628 | .flush= flush_dpb, |
| 3497 | 3629 | .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), |
| 3498 | 3630 | .init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy), |
| @@ -629,7 +629,7 @@ static int decode_band(IVI5DecContext *ctx, int plane_num, · 628 unmodified lines | ||
| 629 | 629 | FFSWAP(int16_t, band->rv_map->valtab[idx1], band->rv_map->valtab[idx2]); |
| 630 | 630 | } |
| 631 | 631 | |
| 632 | −#if IVI_DEBUG | |
| 632 | +#ifdef DEBUG | |
| 633 | 633 | if (band->checksum_present) { |
| 634 | 634 | uint16_t chksum = ivi_calc_band_checksum(band); |
| 635 | 635 | if (chksum != band->checksum) { |
| @@ -46,14 +46,6 @@ · 45 unmodified lines | ||
| 46 | 46 | |
| 47 | 47 | #define PALETTE_COUNT 256 |
| 48 | 48 | |
| 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 | − | |
| 57 | 49 | typedef struct IpvideoContext { |
| 58 | 50 | |
| 59 | 51 | AVCodecContext *avctx; |
| @@ -141,7 +133,7 @@ static int ipvideo_decode_block_opcode_0x2(IpvideoContext *s) · 81 unmodified lines | ||
| 141 | 133 | y = 8 + ((B - 56) / 29); |
| 142 | 134 | } |
| 143 | 135 | |
| 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); | |
| 145 | 137 | return copy_from(s, &s->second_last_frame, x, y); |
| 146 | 138 | } |
| 147 | 139 | |
| @@ -169,7 +161,7 @@ static int ipvideo_decode_block_opcode_0x3(IpvideoContext *s) · 21 unmodified lines | ||
| 169 | 161 | y = -( 8 + ((B - 56) / 29)); |
| 170 | 162 | } |
| 171 | 163 | |
| 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); | |
| 173 | 165 | return copy_from(s, &s->current_frame, x, y); |
| 174 | 166 | } |
| 175 | 167 | |
| @@ -192,7 +184,7 @@ static int ipvideo_decode_block_opcode_0x4(IpvideoContext *s) · 16 unmodified lines | ||
| 192 | 184 | x = -8 + BL; |
| 193 | 185 | y = -8 + BH; |
| 194 | 186 | |
| 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); | |
| 196 | 188 | return copy_from(s, &s->last_frame, x, y); |
| 197 | 189 | } |
| 198 | 190 | |
| @@ -207,7 +199,7 @@ static int ipvideo_decode_block_opcode_0x5(IpvideoContext *s) · 8 unmodified lines | ||
| 207 | 199 | x = *s->stream_ptr++; |
| 208 | 200 | y = *s->stream_ptr++; |
| 209 | 201 | |
| 210 | − debug_interplay (" motion bytes = %d, %d\n", x, y); | |
| 202 | + av_dlog(NULL, " motion bytes = %d, %d\n", x, y); | |
| 211 | 203 | return copy_from(s, &s->last_frame, x, y); |
| 212 | 204 | } |
| 213 | 205 | |
| @@ -588,7 +580,7 @@ static int ipvideo_decode_block_opcode_0x6_16(IpvideoContext *s) · 374 unmodified lines | ||
| 588 | 580 | x = *s->stream_ptr++; |
| 589 | 581 | y = *s->stream_ptr++; |
| 590 | 582 | |
| 591 | − debug_interplay (" motion bytes = %d, %d\n", x, y); | |
| 583 | + av_dlog(NULL, " motion bytes = %d, %d\n", x, y); | |
| 592 | 584 | return copy_from(s, &s->second_last_frame, x, y); |
| 593 | 585 | } |
| 594 | 586 | |
| @@ -965,7 +957,7 @@ static void ipvideo_decode_opcodes(IpvideoContext *s) · 370 unmodified lines | ||
| 965 | 957 | static int frame = 0; |
| 966 | 958 | GetBitContext gb; |
| 967 | 959 | |
| 968 | − debug_interplay("------------------ frame %d\n", frame); | |
| 960 | + av_dlog(NULL, "------------------ frame %d\n", frame); | |
| 969 | 961 | frame++; |
| 970 | 962 | |
| 971 | 963 | if (!s->is_16bpp) { |
| @@ -991,8 +983,8 @@ static void ipvideo_decode_opcodes(IpvideoContext *s) · 19 unmodified lines | ||
| 991 | 983 | for (x = 0; x < s->avctx->width; x += 8) { |
| 992 | 984 | opcode = get_bits(&gb, 4); |
| 993 | 985 | |
| 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); | |
| 996 | 988 | |
| 997 | 989 | if (!s->is_16bpp) { |
| 998 | 990 | s->pixel_ptr = s->current_frame.data[0] + x |
| @@ -152,7 +152,7 @@ int ff_h263_decode_mba(MpegEncContext *s) · 151 unmodified lines | ||
| 152 | 152 | */ |
| 153 | 153 | static int h263_decode_gob_header(MpegEncContext *s) |
| 154 | 154 | { |
| 155 | − unsigned int val, gfid, gob_number; | |
| 155 | + unsigned int val, gob_number; | |
| 156 | 156 | int left; |
| 157 | 157 | |
| 158 | 158 | /* Check for GOB Start Code */ |
| @@ -183,12 +183,12 @@ static int h263_decode_gob_header(MpegEncContext *s) · 24 unmodified lines | ||
| 183 | 183 | s->qscale = get_bits(&s->gb, 5); /* SQUANT */ |
| 184 | 184 | if(get_bits1(&s->gb)==0) |
| 185 | 185 | return -1; |
| 186 | − gfid = get_bits(&s->gb, 2); /* GFID */ | |
| 186 | + skip_bits(&s->gb, 2); /* GFID */ | |
| 187 | 187 | }else{ |
| 188 | 188 | gob_number = get_bits(&s->gb, 5); /* GN */ |
| 189 | 189 | s->mb_x= 0; |
| 190 | 190 | s->mb_y= s->gob_index* gob_number; |
| 191 | − gfid = get_bits(&s->gb, 2); /* GFID */ | |
| 191 | + skip_bits(&s->gb, 2); /* GFID */ | |
| 192 | 192 | s->qscale = get_bits(&s->gb, 5); /* GQUANT */ |
| 193 | 193 | } |
| 194 | 194 | |
| @@ -418,8 +418,8 @@ int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile) · 417 unmodified lines | ||
| 418 | 418 | break; |
| 419 | 419 | pos = band->scan[scan_pos]; |
| 420 | 420 | |
| 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"); | |
| 423 | 423 | |
| 424 | 424 | q = (base_tab[pos] * quant) >> 9; |
| 425 | 425 | if (q > 1) |
| @@ -563,7 +563,7 @@ void ff_ivi_process_empty_tile(AVCodecContext *avctx, IVIBandDesc *band, · 137 unmodified lines | ||
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | |
| 566 | −#if IVI_DEBUG | |
| 566 | +#ifdef DEBUG | |
| 567 | 567 | uint16_t ivi_calc_band_checksum (IVIBandDesc *band) |
| 568 | 568 | { |
| 569 | 569 | int x, y; |
| @@ -33,8 +33,6 @@ · 32 unmodified lines | ||
| 33 | 33 | #include "get_bits.h" |
| 34 | 34 | #include <stdint.h> |
| 35 | 35 | |
| 36 | −#define IVI_DEBUG 0 | |
| 37 | − | |
| 38 | 36 | #define IVI_VLC_BITS 13 ///< max number of bits of the ivi's huffman codes |
| 39 | 37 | |
| 40 | 38 | /** |
| @@ -340,7 +338,6 @@ void ff_ivi_process_empty_tile(AVCodecContext *avctx, IVIBandDesc *band, · 299 unmodified lines | ||
| 340 | 338 | */ |
| 341 | 339 | void ff_ivi_output_plane(IVIPlaneDesc *plane, uint8_t *dst, int dst_pitch); |
| 342 | 340 | |
| 343 | −#if IVI_DEBUG | |
| 344 | 341 | /** |
| 345 | 342 | * Calculate band checksum from band data. |
| 346 | 343 | */ |
| @@ -350,6 +347,5 @@ uint16_t ivi_calc_band_checksum (IVIBandDesc *band); · 3 unmodified lines | ||
| 350 | 347 | * Verify that band data lies in range. |
| 351 | 348 | */ |
| 352 | 349 | int ivi_check_band (IVIBandDesc *band, const uint8_t *ref, int pitch); |
| 353 | −#endif | |
| 354 | 350 | |
| 355 | 351 | #endif /* AVCODEC_IVI_COMMON_H */ |
| @@ -1670,7 +1670,7 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size) · 1669 unmodified lines | ||
| 1670 | 1670 | |
| 1671 | 1671 | *s->current_picture_ptr->pan_scan= s1->pan_scan; |
| 1672 | 1672 | |
| 1673 | − if (HAVE_PTHREADS && avctx->active_thread_type&FF_THREAD_FRAME) | |
| 1673 | + if (HAVE_PTHREADS && (avctx->active_thread_type & FF_THREAD_FRAME)) | |
| 1674 | 1674 | ff_thread_finish_setup(avctx); |
| 1675 | 1675 | }else{ //second field |
| 1676 | 1676 | int i; |
| @@ -2004,7 +2004,7 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict) · 327 unmodified lines | ||
| 2004 | 2004 | *pict= *(AVFrame*)s->current_picture_ptr; |
| 2005 | 2005 | ff_print_debug_info(s, pict); |
| 2006 | 2006 | } else { |
| 2007 | − if (avctx->active_thread_type&FF_THREAD_FRAME) | |
| 2007 | + if (avctx->active_thread_type & FF_THREAD_FRAME) | |
| 2008 | 2008 | s->picture_number++; |
| 2009 | 2009 | /* latency of 1 frame for I- and P-frames */ |
| 2010 | 2010 | /* XXX: use another variable than picture_number */ |
| @@ -2179,14 +2179,13 @@ static void mpeg_decode_gop(AVCodecContext *avctx, · 168 unmodified lines | ||
| 2179 | 2179 | Mpeg1Context *s1 = avctx->priv_data; |
| 2180 | 2180 | MpegEncContext *s = &s1->mpeg_enc_ctx; |
| 2181 | 2181 | |
| 2182 | − int drop_frame_flag; | |
| 2183 | 2182 | int time_code_hours, time_code_minutes; |
| 2184 | 2183 | int time_code_seconds, time_code_pictures; |
| 2185 | 2184 | int broken_link; |
| 2186 | 2185 | |
| 2187 | 2186 | init_get_bits(&s->gb, buf, buf_size*8); |
| 2188 | 2187 | |
| 2189 | − drop_frame_flag = get_bits1(&s->gb); | |
| 2188 | + skip_bits1(&s->gb); /* drop_frame_flag */ | |
| 2190 | 2189 | |
| 2191 | 2190 | time_code_hours=get_bits(&s->gb,5); |
| 2192 | 2191 | time_code_minutes = get_bits(&s->gb,6); |
| @@ -2340,7 +2339,7 @@ static int decode_chunks(AVCodecContext *avctx, · 147 unmodified lines | ||
| 2340 | 2339 | buf_ptr = ff_find_start_code(buf_ptr,buf_end, &start_code); |
| 2341 | 2340 | if (start_code > 0x1ff){ |
| 2342 | 2341 | 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)){ | |
| 2344 | 2343 | int i; |
| 2345 | 2344 | assert(avctx->thread_count > 1); |
| 2346 | 2345 | |
| @@ -2509,7 +2508,7 @@ static int decode_chunks(AVCodecContext *avctx, · 162 unmodified lines | ||
| 2509 | 2508 | break; |
| 2510 | 2509 | } |
| 2511 | 2510 | |
| 2512 | − if(HAVE_THREADS && avctx->active_thread_type&FF_THREAD_SLICE){ | |
| 2511 | + if(HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE)){ | |
| 2513 | 2512 | int threshold= (s2->mb_height*s->slice_count + avctx->thread_count/2) / avctx->thread_count; |
| 2514 | 2513 | assert(avctx->thread_count > 1); |
| 2515 | 2514 | if(threshold <= mb_y){ |
| @@ -761,10 +761,9 @@ void ff_mpeg1_encode_init(MpegEncContext *s) · 760 unmodified lines | ||
| 761 | 761 | |
| 762 | 762 | if(mv==0) len= ff_mpeg12_mbMotionVectorTable[0][1]; |
| 763 | 763 | else{ |
| 764 | − int val, bit_size, range, code; | |
| 764 | + int val, bit_size, code; | |
| 765 | 765 | |
| 766 | 766 | bit_size = f_code - 1; |
| 767 | − range = 1 << bit_size; | |
| 768 | 767 | |
| 769 | 768 | val=mv; |
| 770 | 769 | if (val < 0) |
| @@ -397,14 +397,13 @@ int mpeg4_decode_video_packet_header(MpegEncContext *s) · 396 unmodified lines | ||
| 397 | 397 | header_extension= get_bits1(&s->gb); |
| 398 | 398 | } |
| 399 | 399 | if(header_extension){ |
| 400 | − int time_increment; | |
| 401 | 400 | int time_incr=0; |
| 402 | 401 | |
| 403 | 402 | while (get_bits1(&s->gb) != 0) |
| 404 | 403 | time_incr++; |
| 405 | 404 | |
| 406 | 405 | 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 */ | |
| 408 | 407 | check_marker(&s->gb, "before vop_coding_type in video packed header"); |
| 409 | 408 | |
| 410 | 409 | skip_bits(&s->gb, 2); /* vop coding type */ |
| @@ -1805,16 +1804,14 @@ no_cplx_est: · 1394 unmodified lines | ||
| 1805 | 1804 | |
| 1806 | 1805 | if (s->scalability) { |
| 1807 | 1806 | GetBitContext bak= *gb; |
| 1808 | − int ref_layer_id; | |
| 1809 | − int ref_layer_sampling_dir; | |
| 1810 | 1807 | int h_sampling_factor_n; |
| 1811 | 1808 | int h_sampling_factor_m; |
| 1812 | 1809 | int v_sampling_factor_n; |
| 1813 | 1810 | int v_sampling_factor_m; |
| 1814 | 1811 | |
| 1815 | 1812 | 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 */ | |
| 1818 | 1815 | h_sampling_factor_n= get_bits(gb, 5); |
| 1819 | 1816 | h_sampling_factor_m= get_bits(gb, 5); |
| 1820 | 1817 | v_sampling_factor_n= get_bits(gb, 5); |
| @@ -1993,15 +1990,13 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){ · 172 unmodified lines | ||
| 1993 | 1990 | |
| 1994 | 1991 | if (s->shape != RECT_SHAPE) { |
| 1995 | 1992 | 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 */ | |
| 1999 | 1994 | skip_bits1(gb); /* marker */ |
| 2000 | − height = get_bits(gb, 13); | |
| 1995 | + skip_bits(gb, 13); /* height */ | |
| 2001 | 1996 | skip_bits1(gb); /* marker */ |
| 2002 | − hor_spat_ref = get_bits(gb, 13); /* hor_spat_ref */ | |
| 1997 | + skip_bits(gb, 13); /* hor_spat_ref */ | |
| 2003 | 1998 | skip_bits1(gb); /* marker */ |
| 2004 | − ver_spat_ref = get_bits(gb, 13); /* ver_spat_ref */ | |
| 1999 | + skip_bits(gb, 13); /* ver_spat_ref */ | |
| 2005 | 2000 | } |
| 2006 | 2001 | skip_bits1(gb); /* change_CR_disable */ |
| 2007 | 2002 | |
| @@ -527,7 +527,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst, const AVCodecContext *src · 526 unmodified lines | ||
| 527 | 527 | s->last_pict_type= s1->pict_type; |
| 528 | 528 | if (s1->current_picture_ptr) s->last_lambda_for[s1->pict_type] = s1->current_picture_ptr->quality; |
| 529 | 529 | |
| 530 | − if(s1->pict_type!=AV_PICTURE_TYPE_B){ | |
| 530 | + if(s1->pict_type!=FF_B_TYPE){ | |
| 531 | 531 | s->last_non_b_pict_type= s1->pict_type; |
| 532 | 532 | } |
| 533 | 533 | } |
| @@ -586,7 +586,8 @@ av_cold int MPV_common_init(MpegEncContext *s) · 52 unmodified lines | ||
| 586 | 586 | return -1; |
| 587 | 587 | } |
| 588 | 588 | |
| 589 | − if(s->avctx->active_thread_type&FF_THREAD_SLICE && | |
| 589 | + | |
| 590 | + if((s->avctx->active_thread_type & FF_THREAD_SLICE) && | |
| 590 | 591 | (s->avctx->thread_count > MAX_THREADS || (s->avctx->thread_count > s->mb_height && s->mb_height))){ |
| 591 | 592 | av_log(s->avctx, AV_LOG_ERROR, "too many threads\n"); |
| 592 | 593 | return -1; |
| @@ -763,6 +764,7 @@ av_cold int MPV_common_init(MpegEncContext *s) · 170 unmodified lines | ||
| 763 | 764 | if(init_duplicate_context(s, s) < 0) goto fail; |
| 764 | 765 | s->start_mb_y = 0; |
| 765 | 766 | s->end_mb_y = s->mb_height; |
| 767 | + | |
| 766 | 768 | } |
| 767 | 769 | |
| 768 | 770 | return 0; |
| @@ -2634,6 +2636,6 @@ void ff_set_qscale(MpegEncContext * s, int qscale) · 1865 unmodified lines | ||
| 2634 | 2636 | |
| 2635 | 2637 | void MPV_report_decode_progress(MpegEncContext *s) |
| 2636 | 2638 | { |
| 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) | |
| 2638 | 2640 | ff_thread_report_progress((AVFrame*)s->current_picture_ptr, s->mb_y, 0); |
| 2639 | 2641 | } |
| @@ -474,7 +474,7 @@ typedef struct MpegEncContext { · 473 unmodified lines | ||
| 474 | 474 | int last_bits; ///< temp var used for calculating the above vars |
| 475 | 475 | |
| 476 | 476 | /* error concealment / resync */ |
| 477 | − int error_count; | |
| 477 | + int error_count, error_occurred; | |
| 478 | 478 | uint8_t *error_status_table; ///< table of the error status of each MB |
| 479 | 479 | #define VP_START 1 ///< current MB is the first after a resync marker |
| 480 | 480 | #define AC_ERROR 2 |
| @@ -2759,7 +2759,7 @@ static int encode_picture(MpegEncContext *s, int picture_number) · 2758 unmodified lines | ||
| 2759 | 2759 | { |
| 2760 | 2760 | int i; |
| 2761 | 2761 | 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; | |
| 2763 | 2763 | |
| 2764 | 2764 | s->picture_number = picture_number; |
| 2765 | 2765 | |
| @@ -32,7 +32,7 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, · 31 unmodified lines | ||
| 32 | 32 | uint32_t start_code; |
| 33 | 33 | int frame_rate_index, ext_type, bytes_left; |
| 34 | 34 | 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; | |
| 36 | 36 | int horiz_size_ext, vert_size_ext, bit_rate_ext; |
| 37 | 37 | int did_set_size=0; |
| 38 | 38 | //FIXME replace the crap with get_bits() |
| @@ -91,7 +91,6 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, · 52 unmodified lines | ||
| 91 | 91 | break; |
| 92 | 92 | case 0x8: /* picture coding extension */ |
| 93 | 93 | if (bytes_left >= 5) { |
| 94 | − picture_structure = buf[2]&3; | |
| 95 | 94 | top_field_first = buf[3] & (1 << 7); |
| 96 | 95 | repeat_first_field = buf[3] & (1 << 1); |
| 97 | 96 | progressive_frame = buf[4] & (1 << 7); |
| @@ -1528,9 +1528,7 @@ int msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size) · 1527 unmodified lines | ||
| 1528 | 1528 | /* the alt_bitstream reader could read over the end so we need to check it */ |
| 1529 | 1529 | if(left>=length && left<length+8) |
| 1530 | 1530 | { |
| 1531 | − int fps; | |
| 1532 | − | |
| 1533 | − fps= get_bits(&s->gb, 5); | |
| 1531 | + skip_bits(&s->gb, 5); /* fps */ | |
| 1534 | 1532 | s->bit_rate= get_bits(&s->gb, 11)*1024; |
| 1535 | 1533 | if(s->msmpeg4_version>=3) |
| 1536 | 1534 | s->flipflop_rounding= get_bits1(&s->gb); |
| @@ -379,7 +379,7 @@ static int decode_frame(AVCodecContext *avctx, · 378 unmodified lines | ||
| 379 | 379 | AVFrame *p; |
| 380 | 380 | uint8_t *crow_buf_base = NULL; |
| 381 | 381 | uint32_t tag, length; |
| 382 | − int ret, crc; | |
| 382 | + int ret; | |
| 383 | 383 | |
| 384 | 384 | FFSWAP(AVFrame *, s->current_picture, s->last_picture); |
| 385 | 385 | avctx->coded_frame= s->current_picture; |
| @@ -433,7 +433,7 @@ static int decode_frame(AVCodecContext *avctx, · 47 unmodified lines | ||
| 433 | 433 | s->compression_type = *s->bytestream++; |
| 434 | 434 | s->filter_type = *s->bytestream++; |
| 435 | 435 | s->interlace_type = *s->bytestream++; |
| 436 | − crc = bytestream_get_be32(&s->bytestream); | |
| 436 | + s->bytestream += 4; /* crc */ | |
| 437 | 437 | s->state |= PNG_IHDR; |
| 438 | 438 | av_dlog(avctx, "width=%d height=%d depth=%d color_type=%d compression_type=%d filter_type=%d interlace_type=%d\n", |
| 439 | 439 | s->width, s->height, s->bit_depth, s->color_type, |
| @@ -528,8 +528,7 @@ static int decode_frame(AVCodecContext *avctx, · 88 unmodified lines | ||
| 528 | 528 | s->state |= PNG_IDAT; |
| 529 | 529 | if (png_decode_idat(s, length) < 0) |
| 530 | 530 | goto fail; |
| 531 | − /* skip crc */ | |
| 532 | − crc = bytestream_get_be32(&s->bytestream); | |
| 531 | + s->bytestream += 4; /* crc */ | |
| 533 | 532 | break; |
| 534 | 533 | case MKTAG('P', 'L', 'T', 'E'): |
| 535 | 534 | { |
| @@ -549,7 +548,7 @@ static int decode_frame(AVCodecContext *avctx, · 13 unmodified lines | ||
| 549 | 548 | s->palette[i] = (0xff << 24); |
| 550 | 549 | } |
| 551 | 550 | s->state |= PNG_PLTE; |
| 552 | − crc = bytestream_get_be32(&s->bytestream); | |
| 551 | + s->bytestream += 4; /* crc */ | |
| 553 | 552 | } |
| 554 | 553 | break; |
| 555 | 554 | case MKTAG('t', 'R', 'N', 'S'): |
| @@ -565,13 +564,13 @@ static int decode_frame(AVCodecContext *avctx, · 9 unmodified lines | ||
| 565 | 564 | v = *s->bytestream++; |
| 566 | 565 | s->palette[i] = (s->palette[i] & 0x00ffffff) | (v << 24); |
| 567 | 566 | } |
| 568 | − crc = bytestream_get_be32(&s->bytestream); | |
| 567 | + s->bytestream += 4; /* crc */ | |
| 569 | 568 | } |
| 570 | 569 | break; |
| 571 | 570 | case MKTAG('I', 'E', 'N', 'D'): |
| 572 | 571 | if (!(s->state & PNG_ALLIMAGE)) |
| 573 | 572 | goto fail; |
| 574 | − crc = bytestream_get_be32(&s->bytestream); | |
| 573 | + s->bytestream += 4; /* crc */ | |
| 575 | 574 | goto exit_loop; |
| 576 | 575 | default: |
| 577 | 576 | /* skip tag */ |
| @@ -55,7 +55,7 @@ typedef struct ThreadContext { · 54 unmodified lines | ||
| 55 | 55 | } ThreadContext; |
| 56 | 56 | |
| 57 | 57 | /// Max number of frame buffers that can be allocated when using frame threads. |
| 58 | −#define MAX_BUFFERS 33 | |
| 58 | +#define MAX_BUFFERS (32+1) | |
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * Context used by codec threads and stored in their AVCodecContext thread_opaque. |
| @@ -235,7 +235,7 @@ int rv_decode_dc(MpegEncContext *s, int n) · 234 unmodified lines | ||
| 235 | 235 | /* read RV 1.0 compatible frame header */ |
| 236 | 236 | static int rv10_decode_picture_header(MpegEncContext *s) |
| 237 | 237 | { |
| 238 | − int mb_count, pb_frame, marker, unk av_unused, mb_xy; | |
| 238 | + int mb_count, pb_frame, marker, mb_xy; | |
| 239 | 239 | |
| 240 | 240 | marker = get_bits1(&s->gb); |
| 241 | 241 | |
| @@ -282,7 +282,7 @@ static int rv10_decode_picture_header(MpegEncContext *s) · 40 unmodified lines | ||
| 282 | 282 | s->mb_y = 0; |
| 283 | 283 | mb_count = s->mb_width * s->mb_height; |
| 284 | 284 | } |
| 285 | − unk= get_bits(&s->gb, 3); /* ignored */ | |
| 285 | + skip_bits(&s->gb, 3); /* ignored */ | |
| 286 | 286 | s->f_code = 1; |
| 287 | 287 | s->unrestricted_mv = 1; |
| 288 | 288 | |
| @@ -29,7 +29,7 @@ static int s302m_parse_frame_header(AVCodecContext *avctx, const uint8_t *buf, · 28 unmodified lines | ||
| 29 | 29 | int buf_size) |
| 30 | 30 | { |
| 31 | 31 | uint32_t h; |
| 32 | − int frame_size, channels, id av_unused, bits; | |
| 32 | + int frame_size, channels, bits; | |
| 33 | 33 | |
| 34 | 34 | if (buf_size <= AES3_HEADER_LEN) { |
| 35 | 35 | 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 | ||
| 48 | 48 | h = AV_RB32(buf); |
| 49 | 49 | frame_size = (h >> 16) & 0xffff; |
| 50 | 50 | channels = ((h >> 14) & 0x0003) * 2 + 2; |
| 51 | − id = (h >> 6) & 0x00ff; | |
| 52 | 51 | bits = ((h >> 4) & 0x0003) * 4 + 16; |
| 53 | 52 | |
| 54 | 53 | if (AES3_HEADER_LEN + frame_size != buf_size || bits > 24) { |
| @@ -196,7 +196,6 @@ static int decode_wave_header(AVCodecContext *avctx, uint8_t *header, int header · 195 unmodified lines | ||
| 196 | 196 | { |
| 197 | 197 | GetBitContext hb; |
| 198 | 198 | int len; |
| 199 | − int chunk_size av_unused; | |
| 200 | 199 | short wave_format; |
| 201 | 200 | |
| 202 | 201 | 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 | ||
| 205 | 204 | return -1; |
| 206 | 205 | } |
| 207 | 206 | |
| 208 | − chunk_size = get_le32(&hb); | |
| 207 | + skip_bits_long(&hb, 32); /* chunk_size */ | |
| 209 | 208 | |
| 210 | 209 | if (get_le32(&hb) != MKTAG('W','A','V','E')) { |
| 211 | 210 | av_log(avctx, AV_LOG_ERROR, "missing WAVE tag\n"); |
| @@ -33,7 +33,6 @@ · 32 unmodified lines | ||
| 33 | 33 | */ |
| 34 | 34 | |
| 35 | 35 | |
| 36 | −//#define DEBUG_SVQ1 | |
| 37 | 36 | #include "avcodec.h" |
| 38 | 37 | #include "dsputil.h" |
| 39 | 38 | #include "mpegvideo.h" |
| @@ -238,9 +237,9 @@ static int svq1_decode_block_intra (GetBitContext *bitbuf, uint8_t *pixels, int · 198 unmodified lines | ||
| 238 | 237 | } |
| 239 | 238 | |
| 240 | 239 | 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); | |
| 244 | 243 | return -1; /* invalid vector */ |
| 245 | 244 | } |
| 246 | 245 | |
| @@ -288,9 +287,9 @@ static int svq1_decode_block_non_intra (GetBitContext *bitbuf, uint8_t *pixels, · 41 unmodified lines | ||
| 288 | 287 | if (stages == -1) continue; /* skip vector */ |
| 289 | 288 | |
| 290 | 289 | 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); | |
| 294 | 293 | return -1; /* invalid vector */ |
| 295 | 294 | } |
| 296 | 295 | |
| @@ -499,9 +498,7 @@ static int svq1_decode_delta_block (MpegEncContext *s, GetBitContext *bitbuf, · 202 unmodified lines | ||
| 499 | 498 | |
| 500 | 499 | if (result != 0) |
| 501 | 500 | { |
| 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); | |
| 505 | 502 | break; |
| 506 | 503 | } |
| 507 | 504 | 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 | ||
| 512 | 509 | |
| 513 | 510 | if (result != 0) |
| 514 | 511 | { |
| 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); | |
| 518 | 513 | break; |
| 519 | 514 | } |
| 520 | 515 | 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 | ||
| 554 | 549 | |
| 555 | 550 | static int svq1_decode_frame_header (GetBitContext *bitbuf,MpegEncContext *s) { |
| 556 | 551 | int frame_size_code; |
| 557 | − int temporal_reference; | |
| 558 | 552 | |
| 559 | − temporal_reference = get_bits (bitbuf, 8); | |
| 553 | + skip_bits(bitbuf, 8); /* temporal_reference */ | |
| 560 | 554 | |
| 561 | 555 | /* frame type */ |
| 562 | 556 | s->pict_type= get_bits (bitbuf, 2)+1; |
| @@ -661,9 +655,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, · 98 unmodified lines | ||
| 661 | 655 | |
| 662 | 656 | if (result != 0) |
| 663 | 657 | { |
| 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); | |
| 667 | 659 | return result; |
| 668 | 660 | } |
| 669 | 661 | |
| @@ -712,9 +704,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, · 42 unmodified lines | ||
| 712 | 704 | result = svq1_decode_block_intra (&s->gb, ¤t[x], linesize); |
| 713 | 705 | if (result != 0) |
| 714 | 706 | { |
| 715 | −//#ifdef DEBUG_SVQ1 | |
| 716 | 707 | av_log(s->avctx, AV_LOG_INFO, "Error in svq1_decode_block %i (keyframe)\n",result); |
| 717 | −//#endif | |
| 718 | 708 | goto err; |
| 719 | 709 | } |
| 720 | 710 | } |
| @@ -730,9 +720,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, · 9 unmodified lines | ||
| 730 | 720 | linesize, pmv, x, y); |
| 731 | 721 | if (result != 0) |
| 732 | 722 | { |
| 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); | |
| 736 | 724 | goto err; |
| 737 | 725 | } |
| 738 | 726 | } |
| @@ -108,18 +108,18 @@ static int decode_frame(AVCodecContext *avctx, · 107 unmodified lines | ||
| 108 | 108 | AVFrame * const p= (AVFrame*)&s->picture; |
| 109 | 109 | uint8_t *dst; |
| 110 | 110 | int stride; |
| 111 | − int idlen, pal, compr, x, y, w, h, bpp, flags; | |
| 111 | + int idlen, compr, y, w, h, bpp, flags; | |
| 112 | 112 | int first_clr, colors, csize; |
| 113 | 113 | |
| 114 | 114 | /* parse image header */ |
| 115 | 115 | CHECK_BUFFER_SIZE(buf, buf_end, 18, "header"); |
| 116 | 116 | idlen = *buf++; |
| 117 | − pal = *buf++; | |
| 117 | + buf++; /* pal */ | |
| 118 | 118 | compr = *buf++; |
| 119 | 119 | first_clr = AV_RL16(buf); buf += 2; |
| 120 | 120 | colors = AV_RL16(buf); buf += 2; |
| 121 | 121 | csize = *buf++; |
| 122 | − x = AV_RL16(buf); buf += 2; | |
| 122 | + buf += 2; /* x */ | |
| 123 | 123 | y = AV_RL16(buf); buf += 2; |
| 124 | 124 | w = AV_RL16(buf); buf += 2; |
| 125 | 125 | h = AV_RL16(buf); buf += 2; |
| @@ -210,6 +210,7 @@ static int decode_frame(AVCodecContext *avctx, · 84 unmodified lines | ||
| 210 | 210 | CHECK_BUFFER_SIZE(buf, buf_end, img_size, "image data"); |
| 211 | 211 | for(y = 0; y < s->height; y++){ |
| 212 | 212 | #if HAVE_BIGENDIAN |
| 213 | + int x; | |
| 213 | 214 | if((s->bpp + 1) >> 3 == 2){ |
| 214 | 215 | uint16_t *dst16 = (uint16_t*)dst; |
| 215 | 216 | for(x = 0; x < s->width; x++) |
| @@ -211,19 +211,6 @@ static inline int tm2_read_header(TM2Context *ctx, const uint8_t *buf) · 210 unmodified lines | ||
| 211 | 211 | /* av_log (ctx->avctx, AV_LOG_ERROR, "TM2 old header: not implemented (yet)\n"); */ |
| 212 | 212 | return 40; |
| 213 | 213 | } 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 | − | |
| 227 | 214 | return 40; |
| 228 | 215 | } else { |
| 229 | 216 | av_log (ctx->avctx, AV_LOG_ERROR, "Not a TM2 header: 0x%08X\n", magic); |
| @@ -75,7 +75,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 74 unmodified lines | ||
| 75 | 75 | int buf_size = avpkt->size; |
| 76 | 76 | CamtasiaContext * const c = avctx->priv_data; |
| 77 | 77 | const unsigned char *encoded = buf; |
| 78 | − unsigned char *outptr; | |
| 79 | 78 | int zret; // Zlib return code |
| 80 | 79 | int len = buf_size; |
| 81 | 80 | |
| @@ -89,8 +88,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 7 unmodified lines | ||
| 89 | 88 | return -1; |
| 90 | 89 | } |
| 91 | 90 | |
| 92 | − outptr = c->pic.data[0]; // Output image pointer | |
| 93 | − | |
| 94 | 91 | zret = inflateReset(&(c->zstream)); |
| 95 | 92 | if (zret != Z_OK) { |
| 96 | 93 | av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret); |
| @@ -115,7 +115,7 @@ typedef struct InternalBuffer{ · 114 unmodified lines | ||
| 115 | 115 | enum PixelFormat pix_fmt; |
| 116 | 116 | }InternalBuffer; |
| 117 | 117 | |
| 118 | −#define INTERNAL_BUFFER_SIZE 33 | |
| 118 | +#define INTERNAL_BUFFER_SIZE (32+1) | |
| 119 | 119 | |
| 120 | 120 | void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int linesize_align[4]){ |
| 121 | 121 | int w_align= 1; |
| @@ -20,9 +20,6 @@ · 19 unmodified lines | ||
| 20 | 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | −#undef V_DEBUG | |
| 24 | −//#define V_DEBUG | |
| 25 | − | |
| 26 | 23 | #define ALT_BITSTREAM_READER_LE |
| 27 | 24 | #include "avcodec.h" |
| 28 | 25 | #include "get_bits.h" |
| @@ -57,7 +54,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num) · 28 unmodified lines | ||
| 57 | 54 | |
| 58 | 55 | unsigned i, j, p, code; |
| 59 | 56 | |
| 60 | −#ifdef V_DEBUG | |
| 57 | +#ifdef DEBUG | |
| 61 | 58 | GetBitContext gb; |
| 62 | 59 | #endif |
| 63 | 60 | |
| @@ -74,7 +71,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num) · 10 unmodified lines | ||
| 74 | 71 | for (i = 0; i < bits[p]; ++i) |
| 75 | 72 | exit_at_level[i+1] = 1 << i; |
| 76 | 73 | |
| 77 | −#ifdef V_DEBUG | |
| 74 | +#ifdef DEBUG | |
| 78 | 75 | av_log(NULL, AV_LOG_INFO, " %u. of %u code len %d code %d - ", p, num, bits[p], codes[p]); |
| 79 | 76 | init_get_bits(&gb, (uint8_t *)&codes[p], bits[p]); |
| 80 | 77 | 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 | ||
| 102 | 99 | exit_at_level[j] = code + (1 << (j - 1)); |
| 103 | 100 | codes[p] = code; |
| 104 | 101 | |
| 105 | −#ifdef V_DEBUG | |
| 102 | +#ifdef DEBUG | |
| 106 | 103 | av_log(NULL, AV_LOG_INFO, " %d. code len %d code %d - ", p, bits[p], codes[p]); |
| 107 | 104 | init_get_bits(&gb, (uint8_t *)&codes[p], bits[p]); |
| 108 | 105 | for (i = 0; i < bits[p]; ++i) |
| @@ -20,10 +20,6 @@ · 19 unmodified lines | ||
| 20 | 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | −#undef V_DEBUG | |
| 24 | −//#define V_DEBUG | |
| 25 | −//#define AV_DEBUG(...) av_log(NULL, AV_LOG_INFO, __VA_ARGS__) | |
| 26 | − | |
| 27 | 23 | #include <math.h> |
| 28 | 24 | |
| 29 | 25 | #define ALT_BITSTREAM_READER_LE |
| @@ -41,10 +37,6 @@ · 11 unmodified lines | ||
| 41 | 37 | #define V_MAX_VLCS (1 << 16) |
| 42 | 38 | #define V_MAX_PARTITIONS (1 << 20) |
| 43 | 39 | |
| 44 | −#ifndef V_DEBUG | |
| 45 | −#define AV_DEBUG(...) | |
| 46 | −#endif | |
| 47 | − | |
| 48 | 40 | #undef NDEBUG |
| 49 | 41 | #include <assert.h> |
| 50 | 42 | |
| @@ -245,7 +237,7 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) · 194 unmodified lines | ||
| 245 | 237 | |
| 246 | 238 | vc->codebook_count = get_bits(gb, 8) + 1; |
| 247 | 239 | |
| 248 | − AV_DEBUG(" Codebooks: %d \n", vc->codebook_count); | |
| 240 | + av_dlog(NULL, " Codebooks: %d \n", vc->codebook_count); | |
| 249 | 241 | |
| 250 | 242 | vc->codebooks = av_mallocz(vc->codebook_count * sizeof(*vc->codebooks)); |
| 251 | 243 | 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 | ||
| 256 | 248 | vorbis_codebook *codebook_setup = &vc->codebooks[cb]; |
| 257 | 249 | unsigned ordered, t, entries, used_entries = 0; |
| 258 | 250 | |
| 259 | − AV_DEBUG(" %u. Codebook\n", cb); | |
| 251 | + av_dlog(NULL, " %u. Codebook\n", cb); | |
| 260 | 252 | |
| 261 | 253 | if (get_bits(gb, 24) != 0x564342) { |
| 262 | 254 | av_log(vc->avccontext, AV_LOG_ERROR, |
| @@ -281,17 +273,17 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) · 18 unmodified lines | ||
| 281 | 273 | |
| 282 | 274 | ordered = get_bits1(gb); |
| 283 | 275 | |
| 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); | |
| 286 | 278 | |
| 287 | 279 | if (!ordered) { |
| 288 | 280 | unsigned ce, flag; |
| 289 | 281 | unsigned sparse = get_bits1(gb); |
| 290 | 282 | |
| 291 | − AV_DEBUG(" not ordered \n"); | |
| 283 | + av_dlog(NULL, " not ordered \n"); | |
| 292 | 284 | |
| 293 | 285 | if (sparse) { |
| 294 | − AV_DEBUG(" sparse \n"); | |
| 286 | + av_dlog(NULL, " sparse \n"); | |
| 295 | 287 | |
| 296 | 288 | used_entries = 0; |
| 297 | 289 | for (ce = 0; ce < entries; ++ce) { |
| @@ -303,7 +295,7 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) · 5 unmodified lines | ||
| 303 | 295 | tmp_vlc_bits[ce] = 0; |
| 304 | 296 | } |
| 305 | 297 | } else { |
| 306 | − AV_DEBUG(" not sparse \n"); | |
| 298 | + av_dlog(NULL, " not sparse \n"); | |
| 307 | 299 | |
| 308 | 300 | used_entries = entries; |
| 309 | 301 | for (ce = 0; ce < entries; ++ce) |
| @@ -313,17 +305,17 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) · 3 unmodified lines | ||
| 313 | 305 | unsigned current_entry = 0; |
| 314 | 306 | unsigned current_length = get_bits(gb, 5) + 1; |
| 315 | 307 | |
| 316 | − AV_DEBUG(" ordered, current length: %u\n", current_length); //FIXME | |
| 308 | + av_dlog(NULL, " ordered, current length: %u\n", current_length); //FIXME | |
| 317 | 309 | |
| 318 | 310 | used_entries = entries; |
| 319 | 311 | for (; current_entry < used_entries && current_length <= 32; ++current_length) { |
| 320 | 312 | unsigned i, number; |
| 321 | 313 | |
| 322 | − AV_DEBUG(" number bits: %u ", ilog(entries - current_entry)); | |
| 314 | + av_dlog(NULL, " number bits: %u ", ilog(entries - current_entry)); | |
| 323 | 315 | |
| 324 | 316 | number = get_bits(gb, ilog(entries - current_entry)); |
| 325 | 317 | |
| 326 | − AV_DEBUG(" number: %u\n", number); | |
| 318 | + av_dlog(NULL, " number: %u\n", number); | |
| 327 | 319 | |
| 328 | 320 | for (i = current_entry; i < number+current_entry; ++i) |
| 329 | 321 | if (i < used_entries) |
| @@ -339,7 +331,8 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) · 9 unmodified lines | ||
| 339 | 331 | |
| 340 | 332 | codebook_setup->lookup_type = get_bits(gb, 4); |
| 341 | 333 | |
| 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"); | |
| 343 | 336 | |
| 344 | 337 | // If the codebook is used for (inverse) VQ, calculate codevectors. |
| 345 | 338 | |
| @@ -352,14 +345,17 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) · 6 unmodified lines | ||
| 352 | 345 | unsigned codebook_value_bits = get_bits(gb, 4) + 1; |
| 353 | 346 | unsigned codebook_sequence_p = get_bits1(gb); |
| 354 | 347 | |
| 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); | |
| 357 | 352 | |
| 358 | 353 | for (i = 0; i < codebook_lookup_values; ++i) { |
| 359 | 354 | codebook_multiplicands[i] = get_bits(gb, codebook_value_bits); |
| 360 | 355 | |
| 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]); | |
| 363 | 359 | } |
| 364 | 360 | |
| 365 | 361 | // 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 | ||
| 374 | 370 | float last = 0.0; |
| 375 | 371 | unsigned lookup_offset = i; |
| 376 | 372 | |
| 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); | |
| 380 | 374 | |
| 381 | 375 | for (k = 0; k < dim; ++k) { |
| 382 | 376 | 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 | ||
| 387 | 381 | } |
| 388 | 382 | tmp_vlc_bits[j] = tmp_vlc_bits[i]; |
| 389 | 383 | |
| 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); | |
| 392 | 385 | 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"); | |
| 396 | 389 | |
| 397 | 390 | ++j; |
| 398 | 391 | } |
| @@ -453,8 +446,8 @@ static int vorbis_parse_setup_hdr_tdtransforms(vorbis_context *vc) · 54 unmodified lines | ||
| 453 | 446 | for (i = 0; i < vorbis_time_count; ++i) { |
| 454 | 447 | unsigned vorbis_tdtransform = get_bits(gb, 16); |
| 455 | 448 | |
| 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); | |
| 458 | 451 | |
| 459 | 452 | if (vorbis_tdtransform) { |
| 460 | 453 | 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 | ||
| 485 | 478 | |
| 486 | 479 | floor_setup->floor_type = get_bits(gb, 16); |
| 487 | 480 | |
| 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); | |
| 489 | 482 | |
| 490 | 483 | if (floor_setup->floor_type == 1) { |
| 491 | 484 | int maximum_class = -1; |
| @@ -495,29 +488,33 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc) · 3 unmodified lines | ||
| 495 | 488 | |
| 496 | 489 | floor_setup->data.t1.partitions = get_bits(gb, 5); |
| 497 | 490 | |
| 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); | |
| 499 | 493 | |
| 500 | 494 | for (j = 0; j < floor_setup->data.t1.partitions; ++j) { |
| 501 | 495 | floor_setup->data.t1.partition_class[j] = get_bits(gb, 4); |
| 502 | 496 | if (floor_setup->data.t1.partition_class[j] > maximum_class) |
| 503 | 497 | maximum_class = floor_setup->data.t1.partition_class[j]; |
| 504 | 498 | |
| 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]); | |
| 506 | 501 | |
| 507 | 502 | } |
| 508 | 503 | |
| 509 | − AV_DEBUG(" maximum class %d \n", maximum_class); | |
| 504 | + av_dlog(NULL, " maximum class %d \n", maximum_class); | |
| 510 | 505 | |
| 511 | 506 | for (j = 0; j <= maximum_class; ++j) { |
| 512 | 507 | floor_setup->data.t1.class_dimensions[j] = get_bits(gb, 3) + 1; |
| 513 | 508 | floor_setup->data.t1.class_subclasses[j] = get_bits(gb, 2); |
| 514 | 509 | |
| 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]); | |
| 516 | 513 | |
| 517 | 514 | if (floor_setup->data.t1.class_subclasses[j]) { |
| 518 | 515 | GET_VALIDATED_INDEX(floor_setup->data.t1.class_masterbook[j], 8, vc->codebook_count) |
| 519 | 516 | |
| 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]); | |
| 521 | 518 | } |
| 522 | 519 | |
| 523 | 520 | 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 | ||
| 526 | 523 | VALIDATE_INDEX(bits, vc->codebook_count) |
| 527 | 524 | floor_setup->data.t1.subclass_books[j][k] = bits; |
| 528 | 525 | |
| 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]); | |
| 530 | 527 | } |
| 531 | 528 | } |
| 532 | 529 | |
| @@ -555,8 +552,8 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc) · 22 unmodified lines | ||
| 555 | 552 | for (k = 0; k < floor_setup->data.t1.class_dimensions[floor_setup->data.t1.partition_class[j]]; ++k, ++floor1_values) { |
| 556 | 553 | floor_setup->data.t1.list[floor1_values].x = get_bits(gb, rangebits); |
| 557 | 554 | |
| 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); | |
| 560 | 557 | } |
| 561 | 558 | } |
| 562 | 559 | |
| @@ -608,28 +605,26 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc) · 45 unmodified lines | ||
| 608 | 605 | if (!floor_setup->data.t0.lsp) |
| 609 | 606 | return -1; |
| 610 | 607 | |
| 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); | |
| 624 | 621 | { |
| 625 | 622 | int idx; |
| 626 | 623 | 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]); | |
| 630 | 626 | } |
| 631 | 627 | } |
| 632 | −#endif | |
| 633 | 628 | } else { |
| 634 | 629 | av_log(vc->avccontext, AV_LOG_ERROR, "Invalid floor type!\n"); |
| 635 | 630 | return -1; |
| @@ -648,7 +643,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc) · 12 unmodified lines | ||
| 648 | 643 | vc->residue_count = get_bits(gb, 6)+1; |
| 649 | 644 | vc->residues = av_mallocz(vc->residue_count * sizeof(*vc->residues)); |
| 650 | 645 | |
| 651 | − AV_DEBUG(" There are %d residues. \n", vc->residue_count); | |
| 646 | + av_dlog(NULL, " There are %d residues. \n", vc->residue_count); | |
| 652 | 647 | |
| 653 | 648 | for (i = 0; i < vc->residue_count; ++i) { |
| 654 | 649 | vorbis_residue *res_setup = &vc->residues[i]; |
| @@ -657,7 +652,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc) · 2 unmodified lines | ||
| 657 | 652 | |
| 658 | 653 | res_setup->type = get_bits(gb, 16); |
| 659 | 654 | |
| 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); | |
| 661 | 656 | |
| 662 | 657 | res_setup->begin = get_bits(gb, 24); |
| 663 | 658 | res_setup->end = get_bits(gb, 24); |
| @@ -684,8 +679,9 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc) · 20 unmodified lines | ||
| 684 | 679 | if (!res_setup->classifs) |
| 685 | 680 | return AVERROR(ENOMEM); |
| 686 | 681 | |
| 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); | |
| 689 | 685 | |
| 690 | 686 | for (j = 0; j < res_setup->classifications; ++j) { |
| 691 | 687 | high_bits = 0; |
| @@ -694,7 +690,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc) · 2 unmodified lines | ||
| 694 | 690 | high_bits = get_bits(gb, 5); |
| 695 | 691 | cascade[j] = (high_bits << 3) + low_bits; |
| 696 | 692 | |
| 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])); | |
| 698 | 694 | } |
| 699 | 695 | |
| 700 | 696 | res_setup->maxpass = 0; |
| @@ -703,8 +699,8 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc) · 2 unmodified lines | ||
| 703 | 699 | if (cascade[j]&(1 << k)) { |
| 704 | 700 | GET_VALIDATED_INDEX(res_setup->books[j][k], 8, vc->codebook_count) |
| 705 | 701 | |
| 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]); | |
| 708 | 704 | |
| 709 | 705 | if (k>res_setup->maxpass) |
| 710 | 706 | res_setup->maxpass = k; |
| @@ -727,7 +723,7 @@ static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc) · 16 unmodified lines | ||
| 727 | 723 | vc->mapping_count = get_bits(gb, 6)+1; |
| 728 | 724 | vc->mappings = av_mallocz(vc->mapping_count * sizeof(*vc->mappings)); |
| 729 | 725 | |
| 730 | − AV_DEBUG(" There are %d mappings. \n", vc->mapping_count); | |
| 726 | + av_dlog(NULL, " There are %d mappings. \n", vc->mapping_count); | |
| 731 | 727 | |
| 732 | 728 | for (i = 0; i < vc->mapping_count; ++i) { |
| 733 | 729 | vorbis_mapping *mapping_setup = &vc->mappings[i]; |
| @@ -756,8 +752,8 @@ static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc) · 22 unmodified lines | ||
| 756 | 752 | mapping_setup->coupling_steps = 0; |
| 757 | 753 | } |
| 758 | 754 | |
| 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); | |
| 761 | 757 | |
| 762 | 758 | if (get_bits(gb, 2)) { |
| 763 | 759 | 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 | ||
| 776 | 772 | GET_VALIDATED_INDEX(mapping_setup->submap_floor[j], 8, vc->floor_count) |
| 777 | 773 | GET_VALIDATED_INDEX(mapping_setup->submap_residue[j], 8, vc->residue_count) |
| 778 | 774 | |
| 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]); | |
| 783 | 778 | } |
| 784 | 779 | } |
| 785 | 780 | return 0; |
| @@ -814,12 +809,9 @@ static void create_map(vorbis_context *vc, unsigned floor_number) · 28 unmodified lines | ||
| 814 | 809 | vf->map_size[blockflag] = n; |
| 815 | 810 | } |
| 816 | 811 | |
| 817 | −#ifdef V_DEBUG | |
| 818 | 812 | 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]); | |
| 821 | 814 | } |
| 822 | −#endif | |
| 823 | 815 | } |
| 824 | 816 | |
| 825 | 817 | 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 | ||
| 830 | 822 | vc->mode_count = get_bits(gb, 6) + 1; |
| 831 | 823 | vc->modes = av_mallocz(vc->mode_count * sizeof(*vc->modes)); |
| 832 | 824 | |
| 833 | − AV_DEBUG(" There are %d modes.\n", vc->mode_count); | |
| 825 | + av_dlog(NULL, " There are %d modes.\n", vc->mode_count); | |
| 834 | 826 | |
| 835 | 827 | for (i = 0; i < vc->mode_count; ++i) { |
| 836 | 828 | vorbis_mode *mode_setup = &vc->modes[i]; |
| @@ -840,9 +832,9 @@ static int vorbis_parse_setup_hdr_modes(vorbis_context *vc) · 3 unmodified lines | ||
| 840 | 832 | mode_setup->transformtype = get_bits(gb, 16); //FIXME check |
| 841 | 833 | GET_VALIDATED_INDEX(mode_setup->mapping, 8, vc->mapping_count); |
| 842 | 834 | |
| 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); | |
| 846 | 838 | } |
| 847 | 839 | return 0; |
| 848 | 840 | } |
| @@ -950,7 +942,7 @@ static int vorbis_parse_id_hdr(vorbis_context *vc) · 101 unmodified lines | ||
| 950 | 942 | ff_mdct_init(&vc->mdct[0], bl0, 1, -vc->scale_bias); |
| 951 | 943 | ff_mdct_init(&vc->mdct[1], bl1, 1, -vc->scale_bias); |
| 952 | 944 | |
| 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 ", | |
| 954 | 946 | vc->version, vc->audio_channels, vc->audio_samplerate, vc->bitrate_maximum, vc->bitrate_nominal, vc->bitrate_minimum, vc->blocksize[0], vc->blocksize[1]); |
| 955 | 947 | |
| 956 | 948 | /* |
| @@ -1058,7 +1050,7 @@ static int vorbis_floor0_decode(vorbis_context *vc, · 101 unmodified lines | ||
| 1058 | 1050 | "floor0 dec: booknumber too high!\n"); |
| 1059 | 1051 | book_idx = 0; |
| 1060 | 1052 | } |
| 1061 | − AV_DEBUG("floor0 dec: booknumber: %u\n", book_idx); | |
| 1053 | + av_dlog(NULL, "floor0 dec: booknumber: %u\n", book_idx); | |
| 1062 | 1054 | codebook = vc->codebooks[vf->book_list[book_idx]]; |
| 1063 | 1055 | /* Invalid codebook! */ |
| 1064 | 1056 | if (!codebook.codevectors) |
| @@ -1067,13 +1059,13 @@ static int vorbis_floor0_decode(vorbis_context *vc, · 2 unmodified lines | ||
| 1067 | 1059 | while (lsp_len<vf->order) { |
| 1068 | 1060 | int vec_off; |
| 1069 | 1061 | |
| 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); | |
| 1072 | 1064 | /* read temp vector */ |
| 1073 | 1065 | vec_off = get_vlc2(&vc->gb, codebook.vlc.table, |
| 1074 | 1066 | codebook.nb_bits, codebook.maxdepth) |
| 1075 | 1067 | * 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); | |
| 1077 | 1069 | /* copy each vector component and add last to it */ |
| 1078 | 1070 | for (idx = 0; idx < codebook.dimensions; ++idx) |
| 1079 | 1071 | 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 | ||
| 1081 | 1073 | |
| 1082 | 1074 | lsp_len += codebook.dimensions; |
| 1083 | 1075 | } |
| 1084 | −#ifdef V_DEBUG | |
| 1085 | 1076 | /* DEBUG: output lsp coeffs */ |
| 1086 | 1077 | { |
| 1087 | 1078 | int idx; |
| 1088 | 1079 | 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]); | |
| 1090 | 1081 | } |
| 1091 | −#endif | |
| 1092 | 1082 | |
| 1093 | 1083 | /* synthesize floor output vector */ |
| 1094 | 1084 | { |
| @@ -1099,9 +1089,6 @@ static int vorbis_floor0_decode(vorbis_context *vc, · 4 unmodified lines | ||
| 1099 | 1089 | for (i = 0; i < order; i++) |
| 1100 | 1090 | lsp[i] = 2.0f * cos(lsp[i]); |
| 1101 | 1091 | |
| 1102 | − AV_DEBUG("floor0 synth: map_size = %d; m = %d; wstep = %f\n", | |
| 1103 | − vf->map_size, order, wstep); | |
| 1104 | − | |
| 1105 | 1092 | i = 0; |
| 1106 | 1093 | while (i < vf->map_size[blockflag]) { |
| 1107 | 1094 | int j, iter_cond = vf->map[blockflag][i]; |
| @@ -1141,7 +1128,7 @@ static int vorbis_floor0_decode(vorbis_context *vc, · 33 unmodified lines | ||
| 1141 | 1128 | return 1; |
| 1142 | 1129 | } |
| 1143 | 1130 | |
| 1144 | − AV_DEBUG(" Floor0 decoded\n"); | |
| 1131 | + av_dlog(NULL, " Floor0 decoded\n"); | |
| 1145 | 1132 | |
| 1146 | 1133 | return 0; |
| 1147 | 1134 | } |
| @@ -1168,7 +1155,7 @@ static int vorbis_floor1_decode(vorbis_context *vc, · 20 unmodified lines | ||
| 1168 | 1155 | floor1_Y[0] = get_bits(gb, ilog(range - 1)); |
| 1169 | 1156 | floor1_Y[1] = get_bits(gb, ilog(range - 1)); |
| 1170 | 1157 | |
| 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]); | |
| 1172 | 1159 | |
| 1173 | 1160 | offset = 2; |
| 1174 | 1161 | for (i = 0; i < vf->partitions; ++i) { |
| @@ -1178,7 +1165,7 @@ static int vorbis_floor1_decode(vorbis_context *vc, · 3 unmodified lines | ||
| 1178 | 1165 | csub = (1 << cbits) - 1; |
| 1179 | 1166 | cval = 0; |
| 1180 | 1167 | |
| 1181 | − AV_DEBUG("Cbits %u\n", cbits); | |
| 1168 | + av_dlog(NULL, "Cbits %u\n", cbits); | |
| 1182 | 1169 | |
| 1183 | 1170 | if (cbits) // this reads all subclasses for this partition's class |
| 1184 | 1171 | 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 | ||
| 1187 | 1174 | for (j = 0; j < cdim; ++j) { |
| 1188 | 1175 | book = vf->subclass_books[partition_class][cval & csub]; |
| 1189 | 1176 | |
| 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)); | |
| 1192 | 1179 | |
| 1193 | 1180 | cval = cval >> cbits; |
| 1194 | 1181 | if (book > -1) { |
| @@ -1198,7 +1185,8 @@ static int vorbis_floor1_decode(vorbis_context *vc, · 3 unmodified lines | ||
| 1198 | 1185 | floor1_Y[offset+j] = 0; |
| 1199 | 1186 | } |
| 1200 | 1187 | |
| 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]); | |
| 1202 | 1190 | } |
| 1203 | 1191 | offset+=cdim; |
| 1204 | 1192 | } |
| @@ -1256,15 +1244,15 @@ static int vorbis_floor1_decode(vorbis_context *vc, · 51 unmodified lines | ||
| 1256 | 1244 | floor1_Y_final[i] = predicted; |
| 1257 | 1245 | } |
| 1258 | 1246 | |
| 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); | |
| 1261 | 1249 | } |
| 1262 | 1250 | |
| 1263 | 1251 | // Curve synth - connect the calculated dots and convert from dB scale FIXME optimize ? |
| 1264 | 1252 | |
| 1265 | 1253 | ff_vorbis_floor1_render_list(vf->list, vf->x_list_dim, floor1_Y_final, floor1_flag, vf->multiplier, vec, vf->list[1].x); |
| 1266 | 1254 | |
| 1267 | − AV_DEBUG(" Floor decoded\n"); | |
| 1255 | + av_dlog(NULL, " Floor decoded\n"); | |
| 1268 | 1256 | |
| 1269 | 1257 | return 0; |
| 1270 | 1258 | } |
| @@ -1295,7 +1283,7 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc, · 24 unmodified lines | ||
| 1295 | 1283 | ch_used = ch; |
| 1296 | 1284 | } |
| 1297 | 1285 | |
| 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); | |
| 1299 | 1287 | |
| 1300 | 1288 | for (pass = 0; pass <= vr->maxpass; ++pass) { // FIXME OPTIMIZE? |
| 1301 | 1289 | 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 | ||
| 1309 | 1297 | unsigned temp = get_vlc2(gb, vc->codebooks[vr->classbook].vlc.table, |
| 1310 | 1298 | vc->codebooks[vr->classbook].nb_bits, 3); |
| 1311 | 1299 | |
| 1312 | − AV_DEBUG("Classword: %u\n", temp); | |
| 1300 | + av_dlog(NULL, "Classword: %u\n", temp); | |
| 1313 | 1301 | |
| 1314 | 1302 | assert(vr->classifications > 1 && temp <= 65536); //needed for inverse[] |
| 1315 | 1303 | 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 | ||
| 1354 | 1342 | for (l = 0; l < dim; ++l, ++voffs) { |
| 1355 | 1343 | vec[voffs]+=codebook.codevectors[coffs+l]; // FPMATH |
| 1356 | 1344 | |
| 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); | |
| 1358 | 1347 | } |
| 1359 | 1348 | } |
| 1360 | 1349 | } 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 | ||
| 1381 | 1370 | vec[voffs ] += codebook.codevectors[coffs + l ]; // FPMATH |
| 1382 | 1371 | vec[voffs + vlen] += codebook.codevectors[coffs + l + 1]; // FPMATH |
| 1383 | 1372 | |
| 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); | |
| 1385 | 1377 | } |
| 1386 | 1378 | } |
| 1387 | 1379 | |
| @@ -1393,7 +1385,10 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc, · 5 unmodified lines | ||
| 1393 | 1385 | for (l = 0; l < dim; ++l, ++voffs) { |
| 1394 | 1386 | vec[voffs / ch + (voffs % ch) * vlen] += codebook.codevectors[coffs + l]; // FPMATH FIXME use if and counter instead of / and % |
| 1395 | 1387 | |
| 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); | |
| 1397 | 1392 | } |
| 1398 | 1393 | } |
| 1399 | 1394 | } |
| @@ -1481,8 +1476,8 @@ static int vorbis_parse_audio_packet(vorbis_context *vc) · 81 unmodified lines | ||
| 1481 | 1476 | vc->mode_number = mode_number; |
| 1482 | 1477 | mapping = &vc->mappings[vc->modes[mode_number].mapping]; |
| 1483 | 1478 | |
| 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); | |
| 1486 | 1481 | |
| 1487 | 1482 | blockflag = vc->modes[mode_number].blockflag; |
| 1488 | 1483 | blocksize = vc->blocksize[blockflag]; |
| @@ -1611,7 +1606,7 @@ static int vorbis_decode_frame(AVCodecContext *avccontext, · 122 unmodified lines | ||
| 1611 | 1606 | if (!buf_size) |
| 1612 | 1607 | return 0; |
| 1613 | 1608 | |
| 1614 | − AV_DEBUG("packet length %d \n", buf_size); | |
| 1609 | + av_dlog(NULL, "packet length %d \n", buf_size); | |
| 1615 | 1610 | |
| 1616 | 1611 | init_get_bits(gb, buf, buf_size*8); |
| 1617 | 1612 | |
| @@ -1628,7 +1623,8 @@ static int vorbis_decode_frame(AVCodecContext *avccontext, · 10 unmodified lines | ||
| 1628 | 1623 | return buf_size ; |
| 1629 | 1624 | } |
| 1630 | 1625 | |
| 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); | |
| 1632 | 1628 | |
| 1633 | 1629 | if (vc->audio_channels > 8) { |
| 1634 | 1630 | for (i = 0; i < vc->audio_channels; i++) |
| @@ -90,14 +90,6 @@ · 89 unmodified lines | ||
| 90 | 90 | #define CPLZ_TAG MKBETAG('C', 'P', 'L', 'Z') |
| 91 | 91 | #define VPTZ_TAG MKBETAG('V', 'P', 'T', 'Z') |
| 92 | 92 | |
| 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 | − | |
| 101 | 93 | typedef struct VqaContext { |
| 102 | 94 | |
| 103 | 95 | AVCodecContext *avctx; |
| @@ -213,7 +205,7 @@ static void decode_format80(const unsigned char *src, int src_size, · 109 unmodified lines | ||
| 213 | 205 | |
| 214 | 206 | while (src_index < src_size) { |
| 215 | 207 | |
| 216 | − vqa_debug(" opcode %02X: ", src[src_index]); | |
| 208 | + av_dlog(NULL, " opcode %02X: ", src[src_index]); | |
| 217 | 209 | |
| 218 | 210 | /* 0x80 means that frame is finished */ |
| 219 | 211 | if (src[src_index] == 0x80) |
| @@ -232,7 +224,7 @@ static void decode_format80(const unsigned char *src, int src_size, · 12 unmodified lines | ||
| 232 | 224 | src_index += 2; |
| 233 | 225 | src_pos = AV_RL16(&src[src_index]); |
| 234 | 226 | 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); | |
| 236 | 228 | CHECK_COUNT(); |
| 237 | 229 | for (i = 0; i < count; i++) |
| 238 | 230 | 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 | ||
| 244 | 236 | count = AV_RL16(&src[src_index]); |
| 245 | 237 | src_index += 2; |
| 246 | 238 | 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); | |
| 248 | 240 | CHECK_COUNT(); |
| 249 | 241 | memset(&dest[dest_index], color, count); |
| 250 | 242 | dest_index += count; |
| @@ -254,7 +246,7 @@ static void decode_format80(const unsigned char *src, int src_size, · 3 unmodified lines | ||
| 254 | 246 | count = (src[src_index++] & 0x3F) + 3; |
| 255 | 247 | src_pos = AV_RL16(&src[src_index]); |
| 256 | 248 | 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); | |
| 258 | 250 | CHECK_COUNT(); |
| 259 | 251 | for (i = 0; i < count; i++) |
| 260 | 252 | 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 | ||
| 263 | 255 | } else if (src[src_index] > 0x80) { |
| 264 | 256 | |
| 265 | 257 | 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); | |
| 267 | 259 | CHECK_COUNT(); |
| 268 | 260 | memcpy(&dest[dest_index], &src[src_index], count); |
| 269 | 261 | src_index += count; |
| @@ -274,7 +266,7 @@ static void decode_format80(const unsigned char *src, int src_size, · 4 unmodified lines | ||
| 274 | 266 | count = ((src[src_index] & 0x70) >> 4) + 3; |
| 275 | 267 | src_pos = AV_RB16(&src[src_index]) & 0x0FFF; |
| 276 | 268 | 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); | |
| 278 | 270 | CHECK_COUNT(); |
| 279 | 271 | for (i = 0; i < count; i++) |
| 280 | 272 | dest[dest_index + i] = dest[dest_index - src_pos + i]; |
| @@ -133,7 +133,7 @@ ADD4x4IDCT avx · 132 unmodified lines | ||
| 133 | 133 | %macro ADD16_OP 3 |
| 134 | 134 | cmp byte [r4+%3], 0 |
| 135 | 135 | jz .skipblock%2 |
| 136 | − mov r5d, dword [r1+%2*4] | |
| 136 | + mov r5d, [r1+%2*4] | |
| 137 | 137 | call add4x4_idct_%1 |
| 138 | 138 | .skipblock%2: |
| 139 | 139 | %if %2<15 |
| @@ -159,7 +159,7 @@ cglobal h264_idct_add16_10_%1, 5,6 · 19 unmodified lines | ||
| 159 | 159 | ADD16_OP %1, 13, 7+3*8 |
| 160 | 160 | ADD16_OP %1, 14, 6+4*8 |
| 161 | 161 | ADD16_OP %1, 15, 7+4*8 |
| 162 | − RET | |
| 162 | + REP_RET | |
| 163 | 163 | %endmacro |
| 164 | 164 | |
| 165 | 165 | INIT_XMM |
| @@ -201,7 +201,7 @@ IDCT_ADD16_10 avx · 35 unmodified lines | ||
| 201 | 201 | |
| 202 | 202 | INIT_MMX |
| 203 | 203 | cglobal h264_idct_dc_add_10_mmx2,3,3 |
| 204 | − movd m0, dword [r1] | |
| 204 | + movd m0, [r1] | |
| 205 | 205 | paddd m0, [pd_32] |
| 206 | 206 | psrad m0, 6 |
| 207 | 207 | lea r1, [r2*3] |
| @@ -215,7 +215,7 @@ cglobal h264_idct_dc_add_10_mmx2,3,3 · 7 unmodified lines | ||
| 215 | 215 | ;----------------------------------------------------------------------------- |
| 216 | 216 | %macro IDCT8_DC_ADD 1 |
| 217 | 217 | cglobal h264_idct8_dc_add_10_%1,3,3,7 |
| 218 | − mov r1d, dword [r1] | |
| 218 | + mov r1d, [r1] | |
| 219 | 219 | add r1, 32 |
| 220 | 220 | sar r1, 6 |
| 221 | 221 | movd m0, r1d |
| @@ -240,26 +240,27 @@ IDCT8_DC_ADD avx · 18 unmodified lines | ||
| 240 | 240 | ;----------------------------------------------------------------------------- |
| 241 | 241 | %macro AC 2 |
| 242 | 242 | .ac%2 |
| 243 | − mov r5d, dword [r1+(%2+0)*4] | |
| 243 | + mov r5d, [r1+(%2+0)*4] | |
| 244 | 244 | call add4x4_idct_%1 |
| 245 | − mov r5d, dword [r1+(%2+1)*4] | |
| 245 | + mov r5d, [r1+(%2+1)*4] | |
| 246 | 246 | add r2, 64 |
| 247 | 247 | call add4x4_idct_%1 |
| 248 | 248 | add r2, 64 |
| 249 | 249 | jmp .skipadd%2 |
| 250 | 250 | %endmacro |
| 251 | 251 | |
| 252 | +%assign last_block 16 | |
| 252 | 253 | %macro ADD16_OP_INTRA 3 |
| 253 | − cmp word [r4+%3], 0 | |
| 254 | + cmp word [r4+%3], 0 | |
| 254 | 255 | 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] | |
| 257 | 258 | jz .skipblock%2 |
| 258 | − mov r5d, dword [r1+(%2+0)*4] | |
| 259 | + mov r5d, [r1+(%2+0)*4] | |
| 259 | 260 | call idct_dc_add_%1 |
| 260 | 261 | .skipblock%2: |
| 261 | −%if %2<15 | |
| 262 | − add r2, 128 | |
| 262 | +%if %2<last_block-2 | |
| 263 | + add r2, 128 | |
| 263 | 264 | %endif |
| 264 | 265 | .skipadd%2: |
| 265 | 266 | %endmacro |
| @@ -287,12 +288,15 @@ cglobal h264_idct_add16intra_10_%1,5,7,8 · 21 unmodified lines | ||
| 287 | 288 | ADD16_OP_INTRA %1, 10, 4+4*8 |
| 288 | 289 | ADD16_OP_INTRA %1, 12, 6+3*8 |
| 289 | 290 | 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 | |
| 296 | 300 | %endmacro |
| 297 | 301 | |
| 298 | 302 | INIT_XMM |
| @@ -302,47 +306,33 @@ INIT_AVX · 3 unmodified lines | ||
| 302 | 306 | IDCT_ADD16INTRA_10 avx |
| 303 | 307 | %endif |
| 304 | 308 | |
| 309 | +%assign last_block 24 | |
| 305 | 310 | ;----------------------------------------------------------------------------- |
| 306 | 311 | ; h264_idct_add8(pixel **dst, const int *block_offset, dctcoef *block, int stride, const uint8_t nnzc[6*8]) |
| 307 | 312 | ;----------------------------------------------------------------------------- |
| 308 | 313 | %macro IDCT_ADD8 1 |
| 309 | 314 | 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 | |
| 324 | 315 | %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 | |
| 331 | 317 | %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 | |
| 338 | 322 | %ifdef ARCH_X86_64 |
| 339 | − add r10, gprsize | |
| 323 | + mov r0, [r10+gprsize] | |
| 340 | 324 | %else |
| 341 | − add r0mp, gprsize | |
| 325 | + mov r0, r0m | |
| 326 | + mov r0, [r0+gprsize] | |
| 342 | 327 | %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 | |
| 345 | 330 | REP_RET |
| 331 | + AC %1, 16 | |
| 332 | + AC %1, 18 | |
| 333 | + AC %1, 20 | |
| 334 | + AC %1, 22 | |
| 335 | + | |
| 346 | 336 | %endmacro ; IDCT_ADD8 |
| 347 | 337 | |
| 348 | 338 | INIT_XMM |
| @@ -356,51 +346,51 @@ IDCT_ADD8 avx · 7 unmodified lines | ||
| 356 | 346 | ; void h264_idct8_add(pixel *dst, dctcoef *block, int stride) |
| 357 | 347 | ;----------------------------------------------------------------------------- |
| 358 | 348 | %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 | |
| 404 | 394 | %endmacro |
| 405 | 395 | |
| 406 | 396 | %macro IDCT8_1D_FULL 1 |
| @@ -536,7 +526,7 @@ IDCT8_ADD avx · 129 unmodified lines | ||
| 536 | 526 | %macro IDCT8_ADD4_OP 3 |
| 537 | 527 | cmp byte [r4+%3], 0 |
| 538 | 528 | jz .skipblock%2 |
| 539 | − mov r0d, dword [r6+%2*4] | |
| 529 | + mov r0d, [r6+%2*4] | |
| 540 | 530 | add r0, r5 |
| 541 | 531 | call h264_idct8_add1_10_%1 |
| 542 | 532 | .skipblock%2: |
| @@ -836,7 +836,6 @@ PRED8x8_H ssse3 · 835 unmodified lines | ||
| 836 | 836 | ;----------------------------------------------------------------------------- |
| 837 | 837 | ; void pred8x8_top_dc_mmxext(uint8_t *src, int stride) |
| 838 | 838 | ;----------------------------------------------------------------------------- |
| 839 | −%ifdef CONFIG_GPL | |
| 840 | 839 | cglobal pred8x8_top_dc_mmxext, 2,5 |
| 841 | 840 | sub r0, r1 |
| 842 | 841 | movq mm0, [r0] |
| @@ -927,7 +926,6 @@ cglobal pred8x8_dc_mmxext, 2,5 · 84 unmodified lines | ||
| 927 | 926 | movq [r4+r1*1], m1 |
| 928 | 927 | movq [r4+r1*2], m1 |
| 929 | 928 | RET |
| 930 | −%endif | |
| 931 | 929 | |
| 932 | 930 | ;----------------------------------------------------------------------------- |
| 933 | 931 | ; void pred8x8_dc_rv40(uint8_t *src, int stride) |
| @@ -1083,7 +1081,6 @@ cglobal pred8x8_tm_vp8_ssse3, 2,3,6 · 149 unmodified lines | ||
| 1083 | 1081 | ;----------------------------------------------------------------------------- |
| 1084 | 1082 | ; void pred8x8l_top_dc(uint8_t *src, int has_topleft, int has_topright, int stride) |
| 1085 | 1083 | ;----------------------------------------------------------------------------- |
| 1086 | −%ifdef CONFIG_GPL | |
| 1087 | 1084 | %macro PRED8x8L_TOP_DC 1 |
| 1088 | 1085 | cglobal pred8x8l_top_dc_%1, 4,4 |
| 1089 | 1086 | sub r0, r3 |
| @@ -2476,7 +2473,6 @@ PRED8x8L_HORIZONTAL_DOWN sse2 · 1386 unmodified lines | ||
| 2476 | 2473 | INIT_MMX |
| 2477 | 2474 | %define PALIGNR PALIGNR_SSSE3 |
| 2478 | 2475 | PRED8x8L_HORIZONTAL_DOWN ssse3 |
| 2479 | −%endif | |
| 2480 | 2476 | |
| 2481 | 2477 | ;----------------------------------------------------------------------------- |
| 2482 | 2478 | ; 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 | ||
| 2608 | 2604 | ;----------------------------------------------------------------------------- |
| 2609 | 2605 | ; void pred4x4_down_left_mmxext(uint8_t *src, const uint8_t *topright, int stride) |
| 2610 | 2606 | ;----------------------------------------------------------------------------- |
| 2611 | −%ifdef CONFIG_GPL | |
| 2612 | 2607 | INIT_MMX |
| 2613 | 2608 | cglobal pred4x4_down_left_mmxext, 3,3 |
| 2614 | 2609 | sub r0, r2 |
| @@ -2786,4 +2781,3 @@ cglobal pred4x4_down_right_mmxext, 3,3 · 171 unmodified lines | ||
| 2786 | 2781 | psrlq m0, 8 |
| 2787 | 2782 | movh [r0+r2*1], m0 |
| 2788 | 2783 | RET |
| 2789 | −%endif | |
| @@ -129,7 +129,6 @@ void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth · 128 unmodified lines | ||
| 129 | 129 | h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_mmxext; |
| 130 | 130 | h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_mmxext; |
| 131 | 131 | h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_mmxext; |
| 132 | −#if CONFIG_GPL | |
| 133 | 132 | h->pred8x8l [TOP_DC_PRED ] = ff_pred8x8l_top_dc_mmxext; |
| 134 | 133 | h->pred8x8l [DC_PRED ] = ff_pred8x8l_dc_mmxext; |
| 135 | 134 | 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 | ||
| 142 | 141 | h->pred4x4 [DIAG_DOWN_RIGHT_PRED] = ff_pred4x4_down_right_mmxext; |
| 143 | 142 | h->pred4x4 [VERT_RIGHT_PRED ] = ff_pred4x4_vertical_right_mmxext; |
| 144 | 143 | h->pred4x4 [HOR_DOWN_PRED ] = ff_pred4x4_horizontal_down_mmxext; |
| 145 | −#endif | |
| 146 | 144 | h->pred4x4 [DC_PRED ] = ff_pred4x4_dc_mmxext; |
| 147 | −#if CONFIG_GPL | |
| 148 | 145 | if (codec_id == CODEC_ID_VP8 || codec_id == CODEC_ID_H264) |
| 149 | 146 | h->pred4x4 [DIAG_DOWN_LEFT_PRED ] = ff_pred4x4_down_left_mmxext; |
| 150 | 147 | 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 | ||
| 156 | 153 | h->pred8x8 [TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_mmxext; |
| 157 | 154 | h->pred8x8 [DC_PRED8x8 ] = ff_pred8x8_dc_mmxext; |
| 158 | 155 | } |
| 159 | −#endif | |
| 160 | 156 | if (codec_id == CODEC_ID_VP8) { |
| 161 | 157 | h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_mmxext; |
| 162 | 158 | 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 | ||
| 181 | 177 | |
| 182 | 178 | if (mm_flags & AV_CPU_FLAG_SSE2) { |
| 183 | 179 | h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_sse2; |
| 184 | −#if CONFIG_GPL | |
| 185 | 180 | h->pred8x8l [DIAG_DOWN_LEFT_PRED ] = ff_pred8x8l_down_left_sse2; |
| 186 | 181 | h->pred8x8l [DIAG_DOWN_RIGHT_PRED] = ff_pred8x8l_down_right_sse2; |
| 187 | 182 | h->pred8x8l [VERT_RIGHT_PRED ] = ff_pred8x8l_vertical_right_sse2; |
| 188 | 183 | h->pred8x8l [VERT_LEFT_PRED ] = ff_pred8x8l_vertical_left_sse2; |
| 189 | 184 | h->pred8x8l [HOR_DOWN_PRED ] = ff_pred8x8l_horizontal_down_sse2; |
| 190 | −#endif | |
| 191 | 185 | if (codec_id == CODEC_ID_VP8) { |
| 192 | 186 | h->pred16x16[PLANE_PRED8x8] = ff_pred16x16_tm_vp8_sse2; |
| 193 | 187 | 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 | ||
| 207 | 201 | h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_ssse3; |
| 208 | 202 | h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_ssse3; |
| 209 | 203 | h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_ssse3; |
| 210 | −#if CONFIG_GPL | |
| 211 | 204 | h->pred8x8l [TOP_DC_PRED ] = ff_pred8x8l_top_dc_ssse3; |
| 212 | 205 | h->pred8x8l [DC_PRED ] = ff_pred8x8l_dc_ssse3; |
| 213 | 206 | 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 | ||
| 218 | 211 | h->pred8x8l [VERT_LEFT_PRED ] = ff_pred8x8l_vertical_left_ssse3; |
| 219 | 212 | h->pred8x8l [HOR_UP_PRED ] = ff_pred8x8l_horizontal_up_ssse3; |
| 220 | 213 | h->pred8x8l [HOR_DOWN_PRED ] = ff_pred8x8l_horizontal_down_ssse3; |
| 221 | −#endif | |
| 222 | 214 | if (codec_id == CODEC_ID_VP8) { |
| 223 | 215 | h->pred8x8 [PLANE_PRED8x8] = ff_pred8x8_tm_vp8_ssse3; |
| 224 | 216 | h->pred4x4 [TM_VP8_PRED ] = ff_pred4x4_tm_vp8_ssse3; |
| @@ -54,11 +54,10 @@ typedef struct { · 53 unmodified lines | ||
| 54 | 54 | int video_fd; |
| 55 | 55 | int tuner_fd; |
| 56 | 56 | int width, height; |
| 57 | − int frame_rate; | |
| 58 | − int frame_rate_base; | |
| 59 | 57 | uint64_t per_frame; |
| 60 | 58 | int standard; |
| 61 | 59 | char *video_size; /**< String describing video size, set by a private option. */ |
| 60 | + char *framerate; /**< Set by a private option. */ | |
| 62 | 61 | } VideoData; |
| 63 | 62 | |
| 64 | 63 | |
| @@ -249,8 +248,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) · 184 unmodified lines | ||
| 249 | 248 | VideoData *s = s1->priv_data; |
| 250 | 249 | AVStream *st; |
| 251 | 250 | int width, height; |
| 252 | − int frame_rate; | |
| 253 | − int frame_rate_base; | |
| 251 | + AVRational fps; | |
| 254 | 252 | int ret = 0; |
| 255 | 253 | |
| 256 | 254 | if (ap->time_base.den <= 0) { |
| @@ -262,14 +260,18 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) · 5 unmodified lines | ||
| 262 | 260 | av_log(s1, AV_LOG_ERROR, "Couldn't parse video size.\n"); |
| 263 | 261 | goto out; |
| 264 | 262 | } |
| 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 | + } | |
| 265 | 267 | #if FF_API_FORMAT_PARAMETERS |
| 266 | 268 | if (ap->width > 0) |
| 267 | 269 | width = ap->width; |
| 268 | 270 | if (ap->height > 0) |
| 269 | 271 | height = ap->height; |
| 272 | + if (ap->time_base.num) | |
| 273 | + fps = (AVRational){ap->time_base.den, ap->time_base.num}; | |
| 270 | 274 | #endif |
| 271 | − frame_rate = ap->time_base.den; | |
| 272 | − frame_rate_base = ap->time_base.num; | |
| 273 | 275 | |
| 274 | 276 | st = av_new_stream(s1, 0); |
| 275 | 277 | if (!st) { |
| @@ -280,17 +282,15 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) · 4 unmodified lines | ||
| 280 | 282 | |
| 281 | 283 | s->width = width; |
| 282 | 284 | 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; | |
| 286 | 286 | |
| 287 | 287 | st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
| 288 | 288 | st->codec->pix_fmt = PIX_FMT_YUV420P; |
| 289 | 289 | st->codec->codec_id = CODEC_ID_RAWVIDEO; |
| 290 | 290 | st->codec->width = width; |
| 291 | 291 | 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; | |
| 294 | 294 | |
| 295 | 295 | #if FF_API_FORMAT_PARAMETERS |
| 296 | 296 | if (ap->standard) { |
| @@ -314,6 +314,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) · 17 unmodified lines | ||
| 314 | 314 | |
| 315 | 315 | out: |
| 316 | 316 | av_freep(&s->video_size); |
| 317 | + av_freep(&s->framerate); | |
| 317 | 318 | return ret; |
| 318 | 319 | } |
| 319 | 320 | |
| @@ -346,6 +347,7 @@ static const AVOption options[] = { · 26 unmodified lines | ||
| 346 | 347 | { "PALM", "", 0, FF_OPT_TYPE_CONST, {.dbl = PALM}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" }, |
| 347 | 348 | { "NTSCJ", "", 0, FF_OPT_TYPE_CONST, {.dbl = NTSCJ}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" }, |
| 348 | 349 | { "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 }, | |
| 349 | 351 | { NULL }, |
| 350 | 352 | }; |
| 351 | 353 | |
| @@ -33,9 +33,6 @@ · 32 unmodified lines | ||
| 33 | 33 | #include "libavutil/log.h" |
| 34 | 34 | #include "libavutil/opt.h" |
| 35 | 35 | #include "avdevice.h" |
| 36 | − | |
| 37 | −#undef DV1394_DEBUG | |
| 38 | − | |
| 39 | 36 | #include "libavformat/dv.h" |
| 40 | 37 | #include "dv1394.h" |
| 41 | 38 | |
| @@ -177,15 +174,13 @@ restart_poll: · 135 unmodified lines | ||
| 177 | 174 | av_log(context, AV_LOG_ERROR, "Failed to get status: %s\n", strerror(errno)); |
| 178 | 175 | return AVERROR(EIO); |
| 179 | 176 | } |
| 180 | −#ifdef DV1394_DEBUG | |
| 181 | − av_log(context, AV_LOG_DEBUG, "DV1394: status\n" | |
| 177 | + av_dlog(context, "DV1394: status\n" | |
| 182 | 178 | "\tactive_frame\t%d\n" |
| 183 | 179 | "\tfirst_clear_frame\t%d\n" |
| 184 | 180 | "\tn_clear_frames\t%d\n" |
| 185 | 181 | "\tdropped_frames\t%d\n", |
| 186 | 182 | s.active_frame, s.first_clear_frame, |
| 187 | 183 | s.n_clear_frames, s.dropped_frames); |
| 188 | −#endif | |
| 189 | 184 | |
| 190 | 185 | dv->avail = s.n_clear_frames; |
| 191 | 186 | dv->index = s.first_clear_frame; |
| @@ -200,10 +195,8 @@ restart_poll: · 8 unmodified lines | ||
| 200 | 195 | } |
| 201 | 196 | } |
| 202 | 197 | |
| 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, | |
| 205 | 199 | dv->done); |
| 206 | −#endif | |
| 207 | 200 | |
| 208 | 201 | size = dv_produce_packet(dv->dv_demux, pkt, |
| 209 | 202 | dv->ring + (dv->index * DV1394_PAL_FRAME_SIZE), |
| @@ -37,7 +37,10 @@ · 36 unmodified lines | ||
| 37 | 37 | #include <time.h> |
| 38 | 38 | #include <linux/fb.h> |
| 39 | 39 | |
| 40 | +#include "libavutil/log.h" | |
| 40 | 41 | #include "libavutil/mem.h" |
| 42 | +#include "libavutil/opt.h" | |
| 43 | +#include "libavutil/parseutils.h" | |
| 41 | 44 | #include "libavutil/pixdesc.h" |
| 42 | 45 | #include "avdevice.h" |
| 43 | 46 | |
| @@ -74,8 +77,10 @@ static enum PixelFormat get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *var · 30 unmodified lines | ||
| 74 | 77 | } |
| 75 | 78 | |
| 76 | 79 | typedef struct { |
| 80 | + AVClass *class; ///< class for private options | |
| 77 | 81 | 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 | |
| 79 | 84 | int64_t time_frame; ///< time for the next frame to output (in 1/1000000 units) |
| 80 | 85 | |
| 81 | 86 | int fd; ///< framebuffer device file descriptor |
| @@ -97,16 +102,21 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx, · 15 unmodified lines | ||
| 97 | 102 | enum PixelFormat pix_fmt; |
| 98 | 103 | int ret, flags = O_RDONLY; |
| 99 | 104 | |
| 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 | + | |
| 100 | 116 | if (!(st = av_new_stream(avctx, 0))) |
| 101 | 117 | return AVERROR(ENOMEM); |
| 102 | 118 | av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in microseconds */ |
| 103 | 119 | |
| 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 | − | |
| 110 | 120 | /* NONBLOCK is ignored by the fbdev driver, only set for consistency */ |
| 111 | 121 | if (avctx->flags & AVFMT_FLAG_NONBLOCK) |
| 112 | 122 | flags |= O_NONBLOCK; |
| @@ -146,7 +156,6 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx, · 33 unmodified lines | ||
| 146 | 156 | fbdev->bytes_per_pixel = (fbdev->varinfo.bits_per_pixel + 7) >> 3; |
| 147 | 157 | fbdev->frame_linesize = fbdev->width * fbdev->bytes_per_pixel; |
| 148 | 158 | fbdev->frame_size = fbdev->frame_linesize * fbdev->heigth; |
| 149 | − fbdev->time_base = ap->time_base; | |
| 150 | 159 | fbdev->time_frame = AV_NOPTS_VALUE; |
| 151 | 160 | fbdev->data = mmap(NULL, fbdev->fixinfo.smem_len, PROT_READ, MAP_SHARED, fbdev->fd, 0); |
| 152 | 161 | if (fbdev->data == MAP_FAILED) { |
| @@ -162,13 +171,13 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx, · 9 unmodified lines | ||
| 162 | 171 | st->codec->pix_fmt = pix_fmt; |
| 163 | 172 | st->codec->time_base = ap->time_base; |
| 164 | 173 | 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; | |
| 166 | 175 | |
| 167 | 176 | 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", | |
| 169 | 178 | fbdev->width, fbdev->heigth, fbdev->varinfo.bits_per_pixel, |
| 170 | 179 | av_pix_fmt_descriptors[pix_fmt].name, |
| 171 | − ap->time_base.num, ap->time_base.den, | |
| 180 | + fbdev->fps.num, fbdev->fps.den, | |
| 172 | 181 | st->codec->bit_rate); |
| 173 | 182 | return 0; |
| 174 | 183 | |
| @@ -196,7 +205,7 @@ static int fbdev_read_packet(AVFormatContext *avctx, AVPacket *pkt) · 21 unmodified lines | ||
| 196 | 205 | "time_frame:%"PRId64" curtime:%"PRId64" delay:%"PRId64"\n", |
| 197 | 206 | fbdev->time_frame, curtime, delay); |
| 198 | 207 | 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); | |
| 200 | 209 | break; |
| 201 | 210 | } |
| 202 | 211 | if (avctx->flags & AVFMT_FLAG_NONBLOCK) |
| @@ -240,6 +249,20 @@ av_cold static int fbdev_read_close(AVFormatContext *avctx) · 37 unmodified lines | ||
| 240 | 249 | return 0; |
| 241 | 250 | } |
| 242 | 251 | |
| 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 | + | |
| 243 | 266 | AVInputFormat ff_fbdev_demuxer = { |
| 244 | 267 | .name = "fbdev", |
| 245 | 268 | .long_name = NULL_IF_CONFIG_SMALL("Linux framebuffer"), |
| @@ -248,4 +271,5 @@ AVInputFormat ff_fbdev_demuxer = { · 2 unmodified lines | ||
| 248 | 271 | .read_packet = fbdev_read_packet, |
| 249 | 272 | .read_close = fbdev_read_close, |
| 250 | 273 | .flags = AVFMT_NOFILE, |
| 274 | + .priv_class = &fbdev_class, | |
| 251 | 275 | }; |
| @@ -2,7 +2,6 @@ · 1 unmodified line | ||
| 2 | 2 | * IIDC1394 grab interface (uses libdc1394 and libraw1394) |
| 3 | 3 | * Copyright (c) 2004 Roman Shaposhnik |
| 4 | 4 | * Copyright (c) 2008 Alessandro Sappia |
| 5 | − * Copyright (c) 2011 Martin Lambers | |
| 6 | 5 | * |
| 7 | 6 | * This file is part of FFmpeg. |
| 8 | 7 | * |
| @@ -22,47 +21,63 @@ · 13 unmodified lines | ||
| 22 | 21 | */ |
| 23 | 22 | |
| 24 | 23 | #include "config.h" |
| 24 | +#include "libavformat/avformat.h" | |
| 25 | 25 | #include "libavutil/log.h" |
| 26 | 26 | #include "libavutil/opt.h" |
| 27 | −#include "avdevice.h" | |
| 28 | − | |
| 29 | −#include <stdlib.h> | |
| 30 | −#include <string.h> | |
| 31 | 27 | #include "libavutil/parseutils.h" |
| 32 | 28 | #include "libavutil/pixdesc.h" |
| 33 | 29 | |
| 30 | +#if HAVE_LIBDC1394_2 | |
| 34 | 31 | #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 | |
| 35 | 48 | |
| 36 | 49 | #undef free |
| 37 | 50 | |
| 38 | 51 | typedef struct dc1394_data { |
| 39 | 52 | AVClass *class; |
| 53 | +#if HAVE_LIBDC1394_1 | |
| 54 | + raw1394handle_t handle; | |
| 55 | + dc1394_cameracapture camera; | |
| 56 | + int channel; | |
| 57 | +#elif HAVE_LIBDC1394_2 | |
| 40 | 58 | dc1394_t *d; |
| 41 | 59 | dc1394camera_t *camera; |
| 42 | 60 | dc1394video_frame_t *frame; |
| 61 | +#endif | |
| 43 | 62 | int current_frame; |
| 44 | − int fps; | |
| 63 | + int frame_rate; /**< frames per 1000 seconds (fps * 1000) */ | |
| 45 | 64 | char *video_size; /**< String describing video size, set by a private option. */ |
| 46 | 65 | char *pixel_format; /**< Set by a private option. */ |
| 66 | + char *framerate; /**< Set by a private option. */ | |
| 47 | 67 | |
| 48 | 68 | AVPacket packet; |
| 49 | 69 | } dc1394_data; |
| 50 | 70 | |
| 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 */ | |
| 66 | 81 | }; |
| 67 | 82 | |
| 68 | 83 | struct dc1394_frame_rate { |
| @@ -83,8 +98,12 @@ struct dc1394_frame_rate { · 14 unmodified lines | ||
| 83 | 98 | #define OFFSET(x) offsetof(dc1394_data, x) |
| 84 | 99 | #define DEC AV_OPT_FLAG_DECODING_PARAM |
| 85 | 100 | 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 | |
| 86 | 104 | { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = "qvga"}, 0, 0, DEC }, |
| 87 | 105 | { "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 }, | |
| 88 | 107 | { NULL }, |
| 89 | 108 | }; |
| 90 | 109 | |
| @@ -95,183 +114,220 @@ static const AVClass libdc1394_class = { · 4 unmodified lines | ||
| 95 | 114 | .version = LIBAVUTIL_VERSION_INT, |
| 96 | 115 | }; |
| 97 | 116 | |
| 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) | |
| 99 | 120 | { |
| 100 | 121 | 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); | |
| 121 | 133 | goto out; |
| 122 | 134 | } |
| 123 | 135 | |
| 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; | |
| 244 | 139 | } |
| 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; | |
| 247 | 143 | } |
| 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; | |
| 250 | 169 | } |
| 251 | 170 | |
| 252 | 171 | /* create a video stream */ |
| 253 | 172 | vst = av_new_stream(c, 0); |
| 254 | − if (!vst) | |
| 255 | − goto out_camera; | |
| 173 | + if (!vst) { | |
| 174 | + ret = AVERROR(ENOMEM); | |
| 175 | + goto out; | |
| 176 | + } | |
| 256 | 177 | av_set_pts_info(vst, 64, 1, 1000); |
| 257 | 178 | vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
| 258 | 179 | 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; | |
| 264 | 185 | |
| 265 | 186 | /* packet init */ |
| 266 | 187 | 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); | |
| 268 | 189 | dc1394->packet.stream_index = vst->index; |
| 269 | 190 | dc1394->packet.flags |= AV_PKT_FLAG_KEY; |
| 270 | 191 | |
| 271 | 192 | dc1394->current_frame = 0; |
| 272 | − dc1394->fps = final_frame_rate; | |
| 273 | 193 | |
| 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); | |
| 275 | 331 | |
| 276 | 332 | /* Select MAX Speed possible from the cam */ |
| 277 | 333 | if (dc1394->camera->bmode_capable>0) { |
| @@ -289,13 +345,13 @@ static int dc1394_read_header(AVFormatContext *c, AVFormatParameters * ap) · 11 unmodified lines | ||
| 289 | 345 | goto out_camera; |
| 290 | 346 | } |
| 291 | 347 | |
| 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) { | |
| 293 | 349 | av_log(c, AV_LOG_ERROR, "Couldn't set video format\n"); |
| 294 | 350 | goto out_camera; |
| 295 | 351 | } |
| 296 | 352 | |
| 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); | |
| 299 | 355 | goto out_camera; |
| 300 | 356 | } |
| 301 | 357 | if (dc1394_capture_setup(dc1394->camera, 10, DC1394_CAPTURE_FLAGS_DEFAULT)!=DC1394_SUCCESS) { |
| @@ -314,13 +370,11 @@ out_camera: · 12 unmodified lines | ||
| 314 | 370 | dc1394_video_set_transmission(dc1394->camera, DC1394_OFF); |
| 315 | 371 | dc1394_camera_free (dc1394->camera); |
| 316 | 372 | out: |
| 317 | − av_freep(&dc1394->video_size); | |
| 318 | − av_freep(&dc1394->pixel_format); | |
| 319 | 373 | dc1394_free(dc1394->d); |
| 320 | − return ret; | |
| 374 | + return -1; | |
| 321 | 375 | } |
| 322 | 376 | |
| 323 | −static int dc1394_read_packet(AVFormatContext *c, AVPacket *pkt) | |
| 377 | +static int dc1394_v2_read_packet(AVFormatContext *c, AVPacket *pkt) | |
| 324 | 378 | { |
| 325 | 379 | struct dc1394_data *dc1394 = c->priv_data; |
| 326 | 380 | int res; |
| @@ -334,7 +388,7 @@ static int dc1394_read_packet(AVFormatContext *c, AVPacket *pkt) · 7 unmodified lines | ||
| 334 | 388 | res = dc1394_capture_dequeue(dc1394->camera, DC1394_CAPTURE_POLICY_WAIT, &dc1394->frame); |
| 335 | 389 | if (res == DC1394_SUCCESS) { |
| 336 | 390 | 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); | |
| 338 | 392 | res = dc1394->frame->image_bytes; |
| 339 | 393 | } else { |
| 340 | 394 | 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 | ||
| 346 | 400 | return res; |
| 347 | 401 | } |
| 348 | 402 | |
| 349 | −static int dc1394_close(AVFormatContext * context) | |
| 403 | +static int dc1394_v2_close(AVFormatContext * context) | |
| 350 | 404 | { |
| 351 | 405 | struct dc1394_data *dc1394 = context->priv_data; |
| 352 | 406 | |
| @@ -360,11 +414,25 @@ static int dc1394_close(AVFormatContext * context) · 7 unmodified lines | ||
| 360 | 414 | |
| 361 | 415 | AVInputFormat ff_libdc1394_demuxer = { |
| 362 | 416 | .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"), | |
| 364 | 431 | .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, | |
| 368 | 435 | .flags = AVFMT_NOFILE, |
| 369 | 436 | .priv_class = &libdc1394_class, |
| 370 | 437 | }; |
| 438 | +#endif | |
| @@ -76,6 +76,7 @@ struct video_data { · 75 unmodified lines | ||
| 76 | 76 | int channel; |
| 77 | 77 | char *video_size; /**< String describing video size, set by a private option. */ |
| 78 | 78 | char *pixel_format; /**< Set by a private option. */ |
| 79 | + char *framerate; /**< Set by a private option. */ | |
| 79 | 80 | }; |
| 80 | 81 | |
| 81 | 82 | struct buff_data { |
| @@ -438,12 +439,19 @@ static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap) · 356 unmodified lines | ||
| 438 | 439 | struct v4l2_streamparm streamparm = {0}; |
| 439 | 440 | struct v4l2_fract *tpf = &streamparm.parm.capture.timeperframe; |
| 440 | 441 | int i, ret; |
| 442 | + AVRational fps; | |
| 441 | 443 | |
| 442 | 444 | streamparm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
| 443 | 445 | |
| 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 | + } | |
| 444 | 450 | #if FF_API_FORMAT_PARAMETERS |
| 445 | 451 | if (ap->channel > 0) |
| 446 | 452 | s->channel = ap->channel; |
| 453 | + if (ap->time_base.num) | |
| 454 | + fps = (AVRational){ap->time_base.den, ap->time_base.num}; | |
| 447 | 455 | #endif |
| 448 | 456 | |
| 449 | 457 | /* set tv video input */ |
| @@ -492,34 +500,32 @@ static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap) · 42 unmodified lines | ||
| 492 | 500 | } |
| 493 | 501 | } |
| 494 | 502 | |
| 495 | − if (ap->time_base.num && ap->time_base.den) { | |
| 503 | + if (fps.num && fps.den) { | |
| 496 | 504 | 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; | |
| 500 | 508 | if (ioctl(s->fd, VIDIOC_S_PARM, &streamparm) != 0) { |
| 501 | 509 | av_log(s1, AV_LOG_ERROR, |
| 502 | 510 | "ioctl set time per frame(%d/%d) failed\n", |
| 503 | − ap->time_base.num, ap->time_base.den); | |
| 511 | + fps.den, fps.num); | |
| 504 | 512 | return AVERROR(EIO); |
| 505 | 513 | } |
| 506 | 514 | |
| 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) { | |
| 509 | 517 | av_log(s1, AV_LOG_INFO, |
| 510 | 518 | "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, | |
| 512 | 520 | tpf->numerator, tpf->denominator); |
| 513 | 521 | } |
| 514 | 522 | } 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 */ | |
| 516 | 524 | if (ioctl(s->fd, VIDIOC_G_PARM, &streamparm) != 0) { |
| 517 | 525 | av_log(s1, AV_LOG_ERROR, "ioctl(VIDIOC_G_PARM): %s\n", strerror(errno)); |
| 518 | 526 | return AVERROR(errno); |
| 519 | 527 | } |
| 520 | 528 | } |
| 521 | − ap->time_base.num = tpf->numerator; | |
| 522 | − ap->time_base.den = tpf->denominator; | |
| 523 | 529 | |
| 524 | 530 | return 0; |
| 525 | 531 | } |
| @@ -616,7 +622,7 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap) · 90 unmodified lines | ||
| 616 | 622 | desired_format = device_try_init(s1, pix_fmt, &s->width, &s->height, &codec_id); |
| 617 | 623 | if (desired_format == 0) { |
| 618 | 624 | 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); | |
| 620 | 626 | close(s->fd); |
| 621 | 627 | |
| 622 | 628 | res = AVERROR(EIO); |
| @@ -660,6 +666,7 @@ out: · 37 unmodified lines | ||
| 660 | 666 | av_freep(&s->video_size); |
| 661 | 667 | av_freep(&s->pixel_format); |
| 662 | 668 | av_freep(&s->standard); |
| 669 | + av_freep(&s->framerate); | |
| 663 | 670 | return res; |
| 664 | 671 | } |
| 665 | 672 | |
| @@ -711,6 +718,7 @@ static const AVOption options[] = { · 45 unmodified lines | ||
| 711 | 718 | { "channel", "", OFFSET(channel), FF_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, |
| 712 | 719 | { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, |
| 713 | 720 | { "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 }, | |
| 714 | 722 | { NULL }, |
| 715 | 723 | }; |
| 716 | 724 | |
| @@ -26,8 +26,6 @@ · 25 unmodified lines | ||
| 26 | 26 | #include <vfw.h> |
| 27 | 27 | #include "avdevice.h" |
| 28 | 28 | |
| 29 | −//#define DEBUG_VFW | |
| 30 | − | |
| 31 | 29 | /* Defines for VFW missing from MinGW. |
| 32 | 30 | * Remove this when MinGW incorporates them. */ |
| 33 | 31 | #define HWND_MESSAGE ((HWND)-3) |
| @@ -43,6 +41,7 @@ struct vfw_ctx { · 9 unmodified lines | ||
| 43 | 41 | unsigned int curbufsize; |
| 44 | 42 | unsigned int frame_num; |
| 45 | 43 | char *video_size; /**< A string describing video size, set by a private option. */ |
| 44 | + char *framerate; /**< Set by a private option. */ | |
| 46 | 45 | }; |
| 47 | 46 | |
| 48 | 47 | static enum PixelFormat vfw_pixfmt(DWORD biCompression, WORD biBitCount) |
| @@ -119,7 +118,7 @@ static void dump_captureparms(AVFormatContext *s, CAPTUREPARMS *cparms) · 70 unmodified lines | ||
| 119 | 118 | |
| 120 | 119 | static void dump_videohdr(AVFormatContext *s, VIDEOHDR *vhdr) |
| 121 | 120 | { |
| 122 | −#ifdef DEBUG_VFW | |
| 121 | +#ifdef DEBUG | |
| 123 | 122 | av_log(s, AV_LOG_DEBUG, "VIDEOHDR\n"); |
| 124 | 123 | dstruct(s, vhdr, lpData, "p"); |
| 125 | 124 | dstruct(s, vhdr, dwBufferLength, "lu"); |
| @@ -234,6 +233,7 @@ static int vfw_read_close(AVFormatContext *s) · 108 unmodified lines | ||
| 234 | 233 | } |
| 235 | 234 | |
| 236 | 235 | av_freep(&ctx->video_size); |
| 236 | + av_freep(&ctx->framerate); | |
| 237 | 237 | |
| 238 | 238 | return 0; |
| 239 | 239 | } |
| @@ -250,6 +250,7 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap) · 10 unmodified lines | ||
| 250 | 250 | DWORD biCompression; |
| 251 | 251 | WORD biBitCount; |
| 252 | 252 | int ret; |
| 253 | + AVRational fps; | |
| 253 | 254 | |
| 254 | 255 | if (!strcmp(s->filename, "list")) { |
| 255 | 256 | for (devnum = 0; devnum <= 9; devnum++) { |
| @@ -267,10 +268,10 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap) · 11 unmodified lines | ||
| 267 | 268 | return AVERROR(EIO); |
| 268 | 269 | } |
| 269 | 270 | |
| 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 | |
| 274 | 275 | |
| 275 | 276 | ctx->hwnd = capCreateCaptureWindow(NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, 0); |
| 276 | 277 | if(!ctx->hwnd) { |
| @@ -369,7 +370,7 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap) · 92 unmodified lines | ||
| 369 | 370 | |
| 370 | 371 | cparms.fYield = 1; // Spawn a background thread |
| 371 | 372 | cparms.dwRequestMicroSecPerFrame = |
| 372 | − (ap->time_base.num*1000000) / ap->time_base.den; | |
| 373 | + (fps.den*1000000) / fps.num; | |
| 373 | 374 | cparms.fAbortLeftMouse = 0; |
| 374 | 375 | cparms.fAbortRightMouse = 0; |
| 375 | 376 | cparms.fCaptureAudio = 0; |
| @@ -381,7 +382,7 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap) · 5 unmodified lines | ||
| 381 | 382 | goto fail_io; |
| 382 | 383 | |
| 383 | 384 | codec = st->codec; |
| 384 | − codec->time_base = ap->time_base; | |
| 385 | + codec->time_base = (AVRational){fps.den, fps.num}; | |
| 385 | 386 | codec->codec_type = AVMEDIA_TYPE_VIDEO; |
| 386 | 387 | codec->width = bi->bmiHeader.biWidth; |
| 387 | 388 | codec->height = bi->bmiHeader.biHeight; |
| @@ -469,6 +470,7 @@ static int vfw_read_packet(AVFormatContext *s, AVPacket *pkt) · 81 unmodified lines | ||
| 469 | 470 | #define DEC AV_OPT_FLAG_DECODING_PARAM |
| 470 | 471 | static const AVOption options[] = { |
| 471 | 472 | { "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 }, | |
| 472 | 474 | { NULL }, |
| 473 | 475 | }; |
| 474 | 476 | |
| @@ -246,7 +246,7 @@ static int fourxm_read_packet(AVFormatContext *s, · 245 unmodified lines | ||
| 246 | 246 | FourxmDemuxContext *fourxm = s->priv_data; |
| 247 | 247 | AVIOContext *pb = s->pb; |
| 248 | 248 | unsigned int fourcc_tag; |
| 249 | − unsigned int size, out_size av_unused; | |
| 249 | + unsigned int size; | |
| 250 | 250 | int ret = 0; |
| 251 | 251 | unsigned int track_number; |
| 252 | 252 | int packet_read = 0; |
| @@ -295,7 +295,7 @@ static int fourxm_read_packet(AVFormatContext *s, · 42 unmodified lines | ||
| 295 | 295 | |
| 296 | 296 | case snd__TAG: |
| 297 | 297 | track_number = avio_rl32(pb); |
| 298 | − out_size= avio_rl32(pb); | |
| 298 | + avio_skip(pb, 4); | |
| 299 | 299 | size-=8; |
| 300 | 300 | |
| 301 | 301 | if (track_number < fourxm->track_count && fourxm->tracks[track_number].channels>0) { |
| @@ -26,8 +26,6 @@ · 25 unmodified lines | ||
| 26 | 26 | #include "avformat.h" |
| 27 | 27 | #include "apetag.h" |
| 28 | 28 | |
| 29 | −#define ENABLE_DEBUG 0 | |
| 30 | − | |
| 31 | 29 | /* The earliest and latest file formats supported by this library */ |
| 32 | 30 | #define APE_MIN_VERSION 3950 |
| 33 | 31 | #define APE_MAX_VERSION 3990 |
| @@ -96,7 +94,7 @@ static int ape_probe(AVProbeData * p) · 62 unmodified lines | ||
| 96 | 94 | |
| 97 | 95 | static void ape_dumpinfo(AVFormatContext * s, APEContext * ape_ctx) |
| 98 | 96 | { |
| 99 | −#if ENABLE_DEBUG | |
| 97 | +#ifdef DEBUG | |
| 100 | 98 | int i; |
| 101 | 99 | |
| 102 | 100 | av_log(s, AV_LOG_DEBUG, "Descriptor Block:\n\n"); |
| @@ -24,8 +24,6 @@ · 23 unmodified lines | ||
| 24 | 24 | #include "avformat.h" |
| 25 | 25 | #include "apetag.h" |
| 26 | 26 | |
| 27 | −#define ENABLE_DEBUG 0 | |
| 28 | − | |
| 29 | 27 | #define APE_TAG_VERSION 2000 |
| 30 | 28 | #define APE_TAG_FOOTER_BYTES 32 |
| 31 | 29 | #define APE_TAG_FLAG_CONTAINS_HEADER (1 << 31) |
| @@ -35,11 +33,11 @@ static int ape_tag_read_field(AVFormatContext *s) · 3 unmodified lines | ||
| 35 | 33 | { |
| 36 | 34 | AVIOContext *pb = s->pb; |
| 37 | 35 | uint8_t key[1024], *value; |
| 38 | − uint32_t size, flags av_unused; | |
| 36 | + uint32_t size; | |
| 39 | 37 | int i, c; |
| 40 | 38 | |
| 41 | 39 | size = avio_rl32(pb); /* field size */ |
| 42 | − flags = avio_rl32(pb); /* field flags */ | |
| 40 | + avio_skip(pb, 4); /* field flags */ | |
| 43 | 41 | for (i = 0; i < sizeof(key) - 1; i++) { |
| 44 | 42 | c = avio_r8(pb); |
| 45 | 43 | if (c < 0x20 || c > 0x7E) |
| @@ -209,7 +209,6 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size) · 208 unmodified lines | ||
| 209 | 209 | ff_asf_guid g; |
| 210 | 210 | enum AVMediaType type; |
| 211 | 211 | int type_specific_size, sizeX; |
| 212 | − uint64_t total_size av_unused; | |
| 213 | 212 | unsigned int tag1; |
| 214 | 213 | int64_t pos1, pos2, start_time; |
| 215 | 214 | 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 | ||
| 256 | 255 | return -1; |
| 257 | 256 | } |
| 258 | 257 | ff_get_guid(pb, &g); |
| 259 | − total_size = avio_rl64(pb); | |
| 258 | + avio_skip(pb, 8); /* total_size */ | |
| 260 | 259 | type_specific_size = avio_rl32(pb); |
| 261 | 260 | avio_rl32(pb); |
| 262 | 261 | 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 | ||
| 393 | 392 | AVIOContext *pb = s->pb; |
| 394 | 393 | ff_asf_guid g; |
| 395 | 394 | 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; | |
| 397 | 396 | unsigned int stream_languageid_index; |
| 398 | 397 | |
| 399 | 398 | avio_rl64(pb); // starttime |
| @@ -427,7 +426,7 @@ static int asf_read_ext_stream_properties(AVFormatContext *s, int64_t size) · 27 unmodified lines | ||
| 427 | 426 | |
| 428 | 427 | for (i=0; i<payload_ext_ct; i++){ |
| 429 | 428 | ff_get_guid(pb, &g); |
| 430 | − ext_d=avio_rl16(pb); | |
| 429 | + avio_skip(pb, 2); | |
| 431 | 430 | ext_len=avio_rl32(pb); |
| 432 | 431 | avio_skip(pb, ext_len); |
| 433 | 432 | } |
| @@ -511,7 +510,7 @@ static int asf_read_metadata(AVFormatContext *s, int64_t size) · 77 unmodified lines | ||
| 511 | 510 | { |
| 512 | 511 | AVIOContext *pb = s->pb; |
| 513 | 512 | 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; | |
| 515 | 514 | int ret, i; |
| 516 | 515 | n = avio_rl16(pb); |
| 517 | 516 | |
| @@ -521,7 +520,7 @@ static int asf_read_metadata(AVFormatContext *s, int64_t size) · 3 unmodified lines | ||
| 521 | 520 | avio_rl16(pb); //lang_list_index |
| 522 | 521 | stream_num= avio_rl16(pb); |
| 523 | 522 | name_len= avio_rl16(pb); |
| 524 | − value_type= avio_rl16(pb); | |
| 523 | + avio_skip(pb, 2); /* value_type */ | |
| 525 | 524 | value_len= avio_rl32(pb); |
| 526 | 525 | |
| 527 | 526 | 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 | ||
| 626 | 625 | // if so the next iteration will pick it up |
| 627 | 626 | continue; |
| 628 | 627 | } else if (!ff_guidcmp(&g, &ff_asf_head1_guid)) { |
| 629 | − av_unused int v1, v2; | |
| 630 | 628 | ff_get_guid(pb, &g); |
| 631 | − v1 = avio_rl32(pb); | |
| 632 | − v2 = avio_rl16(pb); | |
| 629 | + avio_skip(pb, 6); | |
| 633 | 630 | continue; |
| 634 | 631 | } else if (!ff_guidcmp(&g, &ff_asf_marker_header)) { |
| 635 | 632 | asf_read_marker(s, gsize); |
| @@ -799,7 +796,7 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){ · 163 unmodified lines | ||
| 799 | 796 | ASFContext *asf = s->priv_data; |
| 800 | 797 | int rsize = 1; |
| 801 | 798 | int num = avio_r8(pb); |
| 802 | − int64_t ts0, ts1 av_unused; | |
| 799 | + int64_t ts0; | |
| 803 | 800 | |
| 804 | 801 | asf->packet_segments--; |
| 805 | 802 | asf->packet_key_frame = num >> 7; |
| @@ -822,7 +819,7 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){ · 16 unmodified lines | ||
| 822 | 819 | // av_log(s, AV_LOG_DEBUG, "\n"); |
| 823 | 820 | avio_skip(pb, 10); |
| 824 | 821 | ts0= avio_rl64(pb); |
| 825 | − ts1= avio_rl64(pb); | |
| 822 | + avio_skip(pb, 8);; | |
| 826 | 823 | avio_skip(pb, 12); |
| 827 | 824 | avio_rl32(pb); |
| 828 | 825 | avio_skip(pb, asf->packet_replic_size - 8 - 38 - 4); |
| @@ -295,9 +295,7 @@ static int gif_write_video(AVFormatContext *s, · 294 unmodified lines | ||
| 295 | 295 | AVCodecContext *enc, const uint8_t *buf, int size) |
| 296 | 296 | { |
| 297 | 297 | AVIOContext *pb = s->pb; |
| 298 | − GIFContext *gif = s->priv_data; | |
| 299 | 298 | int jiffies; |
| 300 | − int64_t delay; | |
| 301 | 299 | |
| 302 | 300 | /* graphic control extension block */ |
| 303 | 301 | avio_w8(pb, 0x21); |
| @@ -307,8 +305,6 @@ static int gif_write_video(AVFormatContext *s, · 3 unmodified lines | ||
| 307 | 305 | |
| 308 | 306 | /* 1 jiffy is 1/70 s */ |
| 309 | 307 | /* the delay_time field indicates the number of jiffies - 1 */ |
| 310 | − delay = gif->file_time - gif->time; | |
| 311 | − | |
| 312 | 308 | /* XXX: should use delay, in order to be more accurate */ |
| 313 | 309 | /* instead of using the same rounded value each time */ |
| 314 | 310 | /* XXX: don't even remember if I really use it for now */ |
| @@ -35,17 +35,6 @@ · 34 unmodified lines | ||
| 35 | 35 | #include "libavutil/intreadwrite.h" |
| 36 | 36 | #include "avformat.h" |
| 37 | 37 | |
| 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 | − | |
| 49 | 38 | #define CHUNK_PREAMBLE_SIZE 4 |
| 50 | 39 | #define OPCODE_PREAMBLE_SIZE 4 |
| 51 | 40 | |
| @@ -150,8 +139,8 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb, · 98 unmodified lines | ||
| 150 | 139 | s->audio_frame_count += |
| 151 | 140 | (s->audio_chunk_size - 6) / s->audio_channels; |
| 152 | 141 | |
| 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); | |
| 155 | 144 | |
| 156 | 145 | chunk_type = CHUNK_VIDEO; |
| 157 | 146 | |
| @@ -195,8 +184,7 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb, · 37 unmodified lines | ||
| 195 | 184 | pkt->stream_index = s->video_stream_index; |
| 196 | 185 | pkt->pts = s->video_pts; |
| 197 | 186 | |
| 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); | |
| 200 | 188 | |
| 201 | 189 | s->video_pts += s->frame_pts_inc; |
| 202 | 190 | |
| @@ -244,36 +232,36 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 41 unmodified lines | ||
| 244 | 232 | chunk_size = AV_RL16(&chunk_preamble[0]); |
| 245 | 233 | chunk_type = AV_RL16(&chunk_preamble[2]); |
| 246 | 234 | |
| 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); | |
| 248 | 236 | |
| 249 | 237 | switch (chunk_type) { |
| 250 | 238 | |
| 251 | 239 | case CHUNK_INIT_AUDIO: |
| 252 | − debug_ipmovie("initialize audio\n"); | |
| 240 | + av_dlog(NULL, "initialize audio\n"); | |
| 253 | 241 | break; |
| 254 | 242 | |
| 255 | 243 | case CHUNK_AUDIO_ONLY: |
| 256 | − debug_ipmovie("audio only\n"); | |
| 244 | + av_dlog(NULL, "audio only\n"); | |
| 257 | 245 | break; |
| 258 | 246 | |
| 259 | 247 | case CHUNK_INIT_VIDEO: |
| 260 | − debug_ipmovie("initialize video\n"); | |
| 248 | + av_dlog(NULL, "initialize video\n"); | |
| 261 | 249 | break; |
| 262 | 250 | |
| 263 | 251 | case CHUNK_VIDEO: |
| 264 | − debug_ipmovie("video (and audio)\n"); | |
| 252 | + av_dlog(NULL, "video (and audio)\n"); | |
| 265 | 253 | break; |
| 266 | 254 | |
| 267 | 255 | case CHUNK_SHUTDOWN: |
| 268 | − debug_ipmovie("shutdown\n"); | |
| 256 | + av_dlog(NULL, "shutdown\n"); | |
| 269 | 257 | break; |
| 270 | 258 | |
| 271 | 259 | case CHUNK_END: |
| 272 | − debug_ipmovie("end\n"); | |
| 260 | + av_dlog(NULL, "end\n"); | |
| 273 | 261 | break; |
| 274 | 262 | |
| 275 | 263 | default: |
| 276 | − debug_ipmovie("invalid chunk\n"); | |
| 264 | + av_dlog(NULL, "invalid chunk\n"); | |
| 277 | 265 | chunk_type = CHUNK_BAD; |
| 278 | 266 | break; |
| 279 | 267 | |
| @@ -299,29 +287,29 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 19 unmodified lines | ||
| 299 | 287 | chunk_size -= OPCODE_PREAMBLE_SIZE; |
| 300 | 288 | chunk_size -= opcode_size; |
| 301 | 289 | 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"); | |
| 303 | 291 | chunk_type = CHUNK_BAD; |
| 304 | 292 | break; |
| 305 | 293 | } |
| 306 | 294 | |
| 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); | |
| 309 | 297 | switch (opcode_type) { |
| 310 | 298 | |
| 311 | 299 | case OPCODE_END_OF_STREAM: |
| 312 | − debug_ipmovie("end of stream\n"); | |
| 300 | + av_dlog(NULL, "end of stream\n"); | |
| 313 | 301 | avio_skip(pb, opcode_size); |
| 314 | 302 | break; |
| 315 | 303 | |
| 316 | 304 | case OPCODE_END_OF_CHUNK: |
| 317 | − debug_ipmovie("end of chunk\n"); | |
| 305 | + av_dlog(NULL, "end of chunk\n"); | |
| 318 | 306 | avio_skip(pb, opcode_size); |
| 319 | 307 | break; |
| 320 | 308 | |
| 321 | 309 | case OPCODE_CREATE_TIMER: |
| 322 | − debug_ipmovie("create timer\n"); | |
| 310 | + av_dlog(NULL, "create timer\n"); | |
| 323 | 311 | if ((opcode_version > 0) || (opcode_size > 6)) { |
| 324 | − debug_ipmovie("bad create_timer opcode\n"); | |
| 312 | + av_dlog(NULL, "bad create_timer opcode\n"); | |
| 325 | 313 | chunk_type = CHUNK_BAD; |
| 326 | 314 | break; |
| 327 | 315 | } |
| @@ -331,14 +319,15 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 3 unmodified lines | ||
| 331 | 319 | break; |
| 332 | 320 | } |
| 333 | 321 | 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])); | |
| 336 | 325 | break; |
| 337 | 326 | |
| 338 | 327 | case OPCODE_INIT_AUDIO_BUFFERS: |
| 339 | − debug_ipmovie("initialize audio buffers\n"); | |
| 328 | + av_dlog(NULL, "initialize audio buffers\n"); | |
| 340 | 329 | 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"); | |
| 342 | 331 | chunk_type = CHUNK_BAD; |
| 343 | 332 | break; |
| 344 | 333 | } |
| @@ -360,23 +349,22 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 15 unmodified lines | ||
| 360 | 349 | s->audio_type = CODEC_ID_PCM_S16LE; |
| 361 | 350 | else |
| 362 | 351 | 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"); | |
| 369 | 357 | break; |
| 370 | 358 | |
| 371 | 359 | case OPCODE_START_STOP_AUDIO: |
| 372 | − debug_ipmovie("start/stop audio\n"); | |
| 360 | + av_dlog(NULL, "start/stop audio\n"); | |
| 373 | 361 | avio_skip(pb, opcode_size); |
| 374 | 362 | break; |
| 375 | 363 | |
| 376 | 364 | case OPCODE_INIT_VIDEO_BUFFERS: |
| 377 | − debug_ipmovie("initialize video buffers\n"); | |
| 365 | + av_dlog(NULL, "initialize video buffers\n"); | |
| 378 | 366 | 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"); | |
| 380 | 368 | chunk_type = CHUNK_BAD; |
| 381 | 369 | break; |
| 382 | 370 | } |
| @@ -392,8 +380,8 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 9 unmodified lines | ||
| 392 | 380 | } else { |
| 393 | 381 | s->video_bpp = 16; |
| 394 | 382 | } |
| 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); | |
| 397 | 385 | break; |
| 398 | 386 | |
| 399 | 387 | case OPCODE_UNKNOWN_06: |
| @@ -403,17 +391,17 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 3 unmodified lines | ||
| 403 | 391 | case OPCODE_UNKNOWN_13: |
| 404 | 392 | case OPCODE_UNKNOWN_14: |
| 405 | 393 | 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); | |
| 407 | 395 | avio_skip(pb, opcode_size); |
| 408 | 396 | break; |
| 409 | 397 | |
| 410 | 398 | case OPCODE_SEND_BUFFER: |
| 411 | − debug_ipmovie("send buffer\n"); | |
| 399 | + av_dlog(NULL, "send buffer\n"); | |
| 412 | 400 | avio_skip(pb, opcode_size); |
| 413 | 401 | break; |
| 414 | 402 | |
| 415 | 403 | case OPCODE_AUDIO_FRAME: |
| 416 | − debug_ipmovie("audio frame\n"); | |
| 404 | + av_dlog(NULL, "audio frame\n"); | |
| 417 | 405 | |
| 418 | 406 | /* log position and move on for now */ |
| 419 | 407 | s->audio_chunk_offset = avio_tell(pb); |
| @@ -422,26 +410,26 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 2 unmodified lines | ||
| 422 | 410 | break; |
| 423 | 411 | |
| 424 | 412 | case OPCODE_SILENCE_FRAME: |
| 425 | − debug_ipmovie("silence frame\n"); | |
| 413 | + av_dlog(NULL, "silence frame\n"); | |
| 426 | 414 | avio_skip(pb, opcode_size); |
| 427 | 415 | break; |
| 428 | 416 | |
| 429 | 417 | case OPCODE_INIT_VIDEO_MODE: |
| 430 | − debug_ipmovie("initialize video mode\n"); | |
| 418 | + av_dlog(NULL, "initialize video mode\n"); | |
| 431 | 419 | avio_skip(pb, opcode_size); |
| 432 | 420 | break; |
| 433 | 421 | |
| 434 | 422 | case OPCODE_CREATE_GRADIENT: |
| 435 | − debug_ipmovie("create gradient\n"); | |
| 423 | + av_dlog(NULL, "create gradient\n"); | |
| 436 | 424 | avio_skip(pb, opcode_size); |
| 437 | 425 | break; |
| 438 | 426 | |
| 439 | 427 | case OPCODE_SET_PALETTE: |
| 440 | − debug_ipmovie("set palette\n"); | |
| 428 | + av_dlog(NULL, "set palette\n"); | |
| 441 | 429 | /* check for the logical maximum palette size |
| 442 | 430 | * (3 * 256 + 4 bytes) */ |
| 443 | 431 | 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"); | |
| 445 | 433 | chunk_type = CHUNK_BAD; |
| 446 | 434 | break; |
| 447 | 435 | } |
| @@ -455,7 +443,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 7 unmodified lines | ||
| 455 | 443 | last_color = first_color + AV_RL16(&scratch[2]) - 1; |
| 456 | 444 | /* sanity check (since they are 16 bit values) */ |
| 457 | 445 | 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", | |
| 459 | 447 | first_color, last_color); |
| 460 | 448 | chunk_type = CHUNK_BAD; |
| 461 | 449 | break; |
| @@ -473,12 +461,12 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 11 unmodified lines | ||
| 473 | 461 | break; |
| 474 | 462 | |
| 475 | 463 | case OPCODE_SET_PALETTE_COMPRESSED: |
| 476 | − debug_ipmovie("set palette compressed\n"); | |
| 464 | + av_dlog(NULL, "set palette compressed\n"); | |
| 477 | 465 | avio_skip(pb, opcode_size); |
| 478 | 466 | break; |
| 479 | 467 | |
| 480 | 468 | case OPCODE_SET_DECODING_MAP: |
| 481 | − debug_ipmovie("set decoding map\n"); | |
| 469 | + av_dlog(NULL, "set decoding map\n"); | |
| 482 | 470 | |
| 483 | 471 | /* log position and move on for now */ |
| 484 | 472 | s->decode_map_chunk_offset = avio_tell(pb); |
| @@ -487,7 +475,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 2 unmodified lines | ||
| 487 | 475 | break; |
| 488 | 476 | |
| 489 | 477 | case OPCODE_VIDEO_DATA: |
| 490 | − debug_ipmovie("set video data\n"); | |
| 478 | + av_dlog(NULL, "set video data\n"); | |
| 491 | 479 | |
| 492 | 480 | /* log position and move on for now */ |
| 493 | 481 | s->video_chunk_offset = avio_tell(pb); |
| @@ -496,7 +484,7 @@ static int process_ipmovie_chunk(IPMVEContext *s, AVIOContext *pb, · 2 unmodified lines | ||
| 496 | 484 | break; |
| 497 | 485 | |
| 498 | 486 | default: |
| 499 | − debug_ipmovie("*** unknown opcode type\n"); | |
| 487 | + av_dlog(NULL, "*** unknown opcode type\n"); | |
| 500 | 488 | chunk_type = CHUNK_BAD; |
| 501 | 489 | break; |
| 502 | 490 | |
| @@ -186,13 +186,13 @@ static int mmf_read_header(AVFormatContext *s, · 185 unmodified lines | ||
| 186 | 186 | unsigned int tag; |
| 187 | 187 | AVIOContext *pb = s->pb; |
| 188 | 188 | AVStream *st; |
| 189 | − int64_t file_size av_unused, size; | |
| 189 | + int64_t size; | |
| 190 | 190 | int rate, params; |
| 191 | 191 | |
| 192 | 192 | tag = avio_rl32(pb); |
| 193 | 193 | if (tag != MKTAG('M', 'M', 'M', 'D')) |
| 194 | 194 | return -1; |
| 195 | − file_size = avio_rb32(pb); | |
| 195 | + avio_skip(pb, 4); /* file_size */ | |
| 196 | 196 | |
| 197 | 197 | /* Skip some unused chunks that may or may not be present */ |
| 198 | 198 | for(;; avio_skip(pb, size)) { |
| @@ -572,10 +572,9 @@ static int mpegps_read_packet(AVFormatContext *s, · 571 unmodified lines | ||
| 572 | 572 | pkt->dts = dts; |
| 573 | 573 | pkt->pos = dummy_pos; |
| 574 | 574 | 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); | |
| 579 | 578 | |
| 580 | 579 | return 0; |
| 581 | 580 | } |
| @@ -1078,10 +1078,8 @@ retry: · 1077 unmodified lines | ||
| 1078 | 1078 | best_dts= pkt_desc->dts; |
| 1079 | 1079 | } |
| 1080 | 1080 | |
| 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); | |
| 1085 | 1083 | if(best_dts == INT64_MAX) |
| 1086 | 1084 | return 0; |
| 1087 | 1085 | |
| @@ -1578,10 +1578,8 @@ static int mpegts_read_header(AVFormatContext *s, · 1577 unmodified lines | ||
| 1578 | 1578 | s->bit_rate = (TS_PACKET_SIZE * 8) * 27e6 / ts->pcr_incr; |
| 1579 | 1579 | st->codec->bit_rate = s->bit_rate; |
| 1580 | 1580 | 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); | |
| 1585 | 1583 | } |
| 1586 | 1584 | |
| 1587 | 1585 | avio_seek(pb, pos, SEEK_SET); |
| @@ -190,7 +190,6 @@ static int decode_main_header(NUTContext *nut){ · 189 unmodified lines | ||
| 190 | 190 | uint64_t tmp, end; |
| 191 | 191 | unsigned int stream_count; |
| 192 | 192 | int i, j, tmp_stream, tmp_mul, tmp_pts, tmp_size, count, tmp_res, tmp_head_idx; |
| 193 | − int64_t tmp_match; | |
| 194 | 193 | |
| 195 | 194 | end= get_packetheader(nut, bc, 1, MAIN_STARTCODE); |
| 196 | 195 | end += avio_tell(bc); |
| @@ -218,7 +217,6 @@ static int decode_main_header(NUTContext *nut){ · 21 unmodified lines | ||
| 218 | 217 | tmp_pts=0; |
| 219 | 218 | tmp_mul=1; |
| 220 | 219 | tmp_stream=0; |
| 221 | − tmp_match= 1-(1LL<<62); | |
| 222 | 220 | tmp_head_idx= 0; |
| 223 | 221 | for(i=0; i<256;){ |
| 224 | 222 | int tmp_flags = ffio_read_varlen(bc); |
| @@ -232,7 +230,7 @@ static int decode_main_header(NUTContext *nut){ · 7 unmodified lines | ||
| 232 | 230 | else tmp_res = 0; |
| 233 | 231 | if(tmp_fields>5) count = ffio_read_varlen(bc); |
| 234 | 232 | else count = tmp_mul - tmp_size; |
| 235 | − if(tmp_fields>6) tmp_match = get_s(bc); | |
| 233 | + if(tmp_fields>6) get_s(bc); | |
| 236 | 234 | if(tmp_fields>7) tmp_head_idx= ffio_read_varlen(bc); |
| 237 | 235 | |
| 238 | 236 | while(tmp_fields-- > 8) |
| @@ -197,8 +197,6 @@ static int ogg_read_page(AVFormatContext *s, int *str) · 196 unmodified lines | ||
| 197 | 197 | int flags, nsegs; |
| 198 | 198 | uint64_t gp; |
| 199 | 199 | uint32_t serial; |
| 200 | − uint32_t seq av_unused; | |
| 201 | − uint32_t crc av_unused; | |
| 202 | 200 | int size, idx; |
| 203 | 201 | uint8_t sync[4]; |
| 204 | 202 | int sp = 0; |
| @@ -232,8 +230,7 @@ static int ogg_read_page(AVFormatContext *s, int *str) · 27 unmodified lines | ||
| 232 | 230 | flags = avio_r8(bc); |
| 233 | 231 | gp = avio_rl64 (bc); |
| 234 | 232 | serial = avio_rl32 (bc); |
| 235 | − seq = avio_rl32 (bc); | |
| 236 | − crc = avio_rl32 (bc); | |
| 233 | + avio_skip(bc, 8); /* seq, crc */ | |
| 237 | 234 | nsegs = avio_r8(bc); |
| 238 | 235 | |
| 239 | 236 | 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 | ||
| 364 | 361 | } |
| 365 | 362 | }while (!complete); |
| 366 | 363 | |
| 367 | − av_dlog(s, "ogg_packet: idx %i, frame size %i, start %i\n", | |
| 368 | − idx, os->psize, os->pstart); | |
| 369 | 364 | |
| 370 | 365 | if (os->granule == -1) |
| 371 | 366 | av_log(s, AV_LOG_WARNING, "Page at %"PRId64" is missing granule\n", os->page_pos); |
| @@ -39,7 +39,6 @@ ogm_header(AVFormatContext *s, int idx) · 38 unmodified lines | ||
| 39 | 39 | const uint8_t *p = os->buf + os->pstart; |
| 40 | 40 | uint64_t time_unit; |
| 41 | 41 | uint64_t spu; |
| 42 | − uint32_t default_len av_unused; | |
| 43 | 42 | |
| 44 | 43 | if(!(*p & 1)) |
| 45 | 44 | return 0; |
| @@ -74,8 +73,7 @@ ogm_header(AVFormatContext *s, int idx) · 28 unmodified lines | ||
| 74 | 73 | |
| 75 | 74 | time_unit = bytestream_get_le64(&p); |
| 76 | 75 | spu = bytestream_get_le64(&p); |
| 77 | − default_len = bytestream_get_le32(&p); | |
| 78 | − | |
| 76 | + p += 4; /* default_len */ | |
| 79 | 77 | p += 8; /* buffersize + bits_per_sample */ |
| 80 | 78 | |
| 81 | 79 | if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){ |
| @@ -80,6 +80,8 @@ static int oma_read_header(AVFormatContext *s, · 79 unmodified lines | ||
| 80 | 80 | |
| 81 | 81 | ff_id3v2_read(s, ID3v2_EA3_MAGIC); |
| 82 | 82 | ret = avio_read(s->pb, buf, EA3_HEADER_SIZE); |
| 83 | + if (ret < EA3_HEADER_SIZE) | |
| 84 | + return -1; | |
| 83 | 85 | |
| 84 | 86 | if (memcmp(buf, ((const uint8_t[]){'E', 'A', '3'}),3) || buf[4] != 0 || buf[5] != EA3_HEADER_SIZE) { |
| 85 | 87 | av_log(s, AV_LOG_ERROR, "Couldn't find the EA3 header !\n"); |
| @@ -80,8 +80,6 @@ static av_cold int rl2_read_header(AVFormatContext *s, · 79 unmodified lines | ||
| 80 | 80 | unsigned int audio_frame_counter = 0; |
| 81 | 81 | unsigned int video_frame_counter = 0; |
| 82 | 82 | unsigned int back_size; |
| 83 | − int data_size av_unused; | |
| 84 | − unsigned short encoding_method av_unused; | |
| 85 | 83 | unsigned short sound_rate; |
| 86 | 84 | unsigned short rate; |
| 87 | 85 | unsigned short channels; |
| @@ -98,14 +96,14 @@ static av_cold int rl2_read_header(AVFormatContext *s, · 10 unmodified lines | ||
| 98 | 96 | avio_skip(pb,4); /* skip FORM tag */ |
| 99 | 97 | back_size = avio_rl32(pb); /**< get size of the background frame */ |
| 100 | 98 | signature = avio_rb32(pb); |
| 101 | − data_size = avio_rb32(pb); | |
| 99 | + avio_skip(pb, 4); /* data size */ | |
| 102 | 100 | frame_count = avio_rl32(pb); |
| 103 | 101 | |
| 104 | 102 | /* disallow back_sizes and frame_counts that may lead to overflows later */ |
| 105 | 103 | if(back_size > INT_MAX/2 || frame_count > INT_MAX / sizeof(uint32_t)) |
| 106 | 104 | return AVERROR_INVALIDDATA; |
| 107 | 105 | |
| 108 | − encoding_method = avio_rl16(pb); | |
| 106 | + avio_skip(pb, 2); /* encoding mentod */ | |
| 109 | 107 | sound_rate = avio_rl16(pb); |
| 110 | 108 | rate = avio_rl16(pb); |
| 111 | 109 | channels = avio_rl16(pb); |
| @@ -280,7 +280,7 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb, · 279 unmodified lines | ||
| 280 | 280 | if (rm_read_audio_stream_info(s, pb, st, rst, 0)) |
| 281 | 281 | return -1; |
| 282 | 282 | } else { |
| 283 | − int fps, fps2 av_unused; | |
| 283 | + int fps; | |
| 284 | 284 | if (avio_rl32(pb) != MKTAG('V', 'I', 'D', 'O')) { |
| 285 | 285 | fail1: |
| 286 | 286 | 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 | ||
| 298 | 298 | fps= avio_rb16(pb); |
| 299 | 299 | st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
| 300 | 300 | avio_rb32(pb); |
| 301 | − fps2= avio_rb16(pb); | |
| 301 | + avio_skip(pb, 2); | |
| 302 | 302 | avio_rb16(pb); |
| 303 | 303 | |
| 304 | 304 | if ((ret = rm_read_extradata(pb, st->codec, codec_data_size - (avio_tell(pb) - codec_pos))) < 0) |
| @@ -299,9 +299,9 @@ static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt) · 298 unmodified lines | ||
| 299 | 299 | stream->codec->codec_tag == 124) { |
| 300 | 300 | // We have to split Escape 124 frames because there are |
| 301 | 301 | // multiple frames per chunk in Escape 124 samples. |
| 302 | − uint32_t frame_size, frame_flags av_unused; | |
| 302 | + uint32_t frame_size; | |
| 303 | 303 | |
| 304 | − frame_flags = avio_rl32(pb); | |
| 304 | + avio_skip(pb, 4); /* flags */ | |
| 305 | 305 | frame_size = avio_rl32(pb); |
| 306 | 306 | if (avio_seek(pb, -8, SEEK_CUR) < 0) |
| 307 | 307 | return AVERROR(EIO); |
| @@ -108,8 +108,7 @@ static int parse_fmtp_config(AVStream *st, char *value) · 107 unmodified lines | ||
| 108 | 108 | int len = ff_hex_to_data(NULL, value), i, ret = 0; |
| 109 | 109 | GetBitContext gb; |
| 110 | 110 | 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; | |
| 113 | 112 | |
| 114 | 113 | /* Pad this buffer, too, to avoid out of bounds reads with get_bits below */ |
| 115 | 114 | 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 | ||
| 119 | 118 | init_get_bits(&gb, config, len*8); |
| 120 | 119 | audio_mux_version = get_bits(&gb, 1); |
| 121 | 120 | same_time_framing = get_bits(&gb, 1); |
| 122 | − num_sub_frames = get_bits(&gb, 6); | |
| 121 | + skip_bits(&gb, 6); /* num_sub_frames */ | |
| 123 | 122 | num_programs = get_bits(&gb, 4); |
| 124 | 123 | num_layers = get_bits(&gb, 3); |
| 125 | 124 | if (audio_mux_version != 0 || same_time_framing != 1 || num_programs != 0 || |
| @@ -45,7 +45,6 @@ · 44 unmodified lines | ||
| 45 | 45 | #include "url.h" |
| 46 | 46 | |
| 47 | 47 | //#define DEBUG |
| 48 | −//#define DEBUG_RTP_TCP | |
| 49 | 48 | |
| 50 | 49 | /* Timeout values for socket poll, in ms, |
| 51 | 50 | * and read_packet(), in seconds */ |
| @@ -860,9 +859,7 @@ int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply, · 808 unmodified lines | ||
| 860 | 859 | q = buf; |
| 861 | 860 | for (;;) { |
| 862 | 861 | ret = ffurl_read_complete(rt->rtsp_hd, &ch, 1); |
| 863 | −#ifdef DEBUG_RTP_TCP | |
| 864 | 862 | av_dlog(s, "ret=%d c=%02x [%c]\n", ret, ch, ch); |
| 865 | −#endif | |
| 866 | 863 | if (ret != 1) |
| 867 | 864 | return AVERROR_EOF; |
| 868 | 865 | if (ch == '\n') |
| @@ -32,7 +32,7 @@ int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int g · 31 unmodified lines | ||
| 32 | 32 | { |
| 33 | 33 | AVIOContext *pb = avctx->pb; |
| 34 | 34 | char buf[36]; |
| 35 | − int datatype, filetype, t1, t2, nb_comments, flags av_unused; | |
| 35 | + int datatype, filetype, t1, t2, nb_comments; | |
| 36 | 36 | uint64_t start_pos = avio_size(pb) - 128; |
| 37 | 37 | |
| 38 | 38 | 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 | ||
| 57 | 57 | t1 = avio_rl16(pb); |
| 58 | 58 | t2 = avio_rl16(pb); |
| 59 | 59 | nb_comments = avio_r8(pb); |
| 60 | − flags = avio_r8(pb); | |
| 60 | + avio_skip(pb, 1); /* flags */ | |
| 61 | 61 | avio_skip(pb, 4); |
| 62 | 62 | GET_SAUCE_META("encoder", 22); |
| 63 | 63 | |
| @@ -85,7 +85,6 @@ static int sol_channels(int magic, int type) · 84 unmodified lines | ||
| 85 | 85 | static int sol_read_header(AVFormatContext *s, |
| 86 | 86 | AVFormatParameters *ap) |
| 87 | 87 | { |
| 88 | − int size av_unused; | |
| 89 | 88 | unsigned int magic,tag; |
| 90 | 89 | AVIOContext *pb = s->pb; |
| 91 | 90 | unsigned int id, channels, rate, type; |
| @@ -99,7 +98,7 @@ static int sol_read_header(AVFormatContext *s, · 7 unmodified lines | ||
| 99 | 98 | return -1; |
| 100 | 99 | rate = avio_rl16(pb); |
| 101 | 100 | type = avio_r8(pb); |
| 102 | − size = avio_rl32(pb); | |
| 101 | + avio_skip(pb, 4); /* size */ | |
| 103 | 102 | if (magic != 0x0B8D) |
| 104 | 103 | avio_r8(pb); /* newer SOLs contain padding byte */ |
| 105 | 104 | |
| @@ -179,23 +179,23 @@ FATE_H264 := $(FATE_H264:%=fate-h264-conformance-%) \ · 178 unmodified lines | ||
| 179 | 179 | FATE_TESTS += $(FATE_H264) |
| 180 | 180 | fate-h264: $(FATE_H264) |
| 181 | 181 | |
| 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 | |
| 186 | 186 | 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 | |
| 196 | 196 | fate-h264-conformance-caba3_sony_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CABA3_Sony_C.jsv |
| 197 | 197 | 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 | |
| 199 | 199 | fate-h264-conformance-cabac_mot_fld0_full: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/camp_mot_fld0_full.26l |
| 200 | 200 | fate-h264-conformance-cabac_mot_frm0_full: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/camp_mot_frm0_full.26l |
| 201 | 201 | 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 | ||
| 206 | 206 | fate-h264-conformance-cabref3_sand_d: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CABREF3_Sand_D.264 |
| 207 | 207 | fate-h264-conformance-cacqp3_sony_d: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CACQP3_Sony_D.jsv |
| 208 | 208 | 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 | |
| 210 | 210 | fate-h264-conformance-cama1_toshiba_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAMA1_TOSHIBA_B.264 |
| 211 | 211 | fate-h264-conformance-cama1_vtc_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/cama1_vtc_c.avc |
| 212 | 212 | 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 | ||
| 219 | 219 | fate-h264-conformance-camasl3_sony_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAMASL3_Sony_B.jsv |
| 220 | 220 | fate-h264-conformance-camp_mot_mbaff_l30: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAMP_MOT_MBAFF_L30.26l |
| 221 | 221 | 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 | |
| 227 | 227 | 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 | |
| 232 | 232 | fate-h264-conformance-capa1_toshiba_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CAPA1_TOSHIBA_B.264 |
| 233 | 233 | 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 | |
| 236 | 236 | 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 | |
| 238 | 238 | fate-h264-conformance-cavlc_mot_fld0_full_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/cvmp_mot_fld0_full_B.26l |
| 239 | 239 | fate-h264-conformance-cavlc_mot_frm0_full_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/cvmp_mot_frm0_full_B.26l |
| 240 | 240 | fate-h264-conformance-cavlc_mot_mbaff0_full_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/cvmp_mot_mbaff0_full_B.26l |
| 241 | 241 | 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 | |
| 243 | 243 | 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 | |
| 246 | 246 | 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 | |
| 248 | 248 | fate-h264-conformance-cvfi1_sony_d: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVFI1_Sony_D.jsv |
| 249 | 249 | fate-h264-conformance-cvfi1_sva_c: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVFI1_SVA_C.264 |
| 250 | 250 | fate-h264-conformance-cvfi2_sony_h: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVFI2_Sony_H.jsv |
| 251 | 251 | 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 | |
| 253 | 253 | fate-h264-conformance-cvma1_toshiba_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVMA1_TOSHIBA_B.264 |
| 254 | 254 | fate-h264-conformance-cvmanl1_toshiba_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVMANL1_TOSHIBA_B.264 |
| 255 | 255 | 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 | ||
| 261 | 261 | fate-h264-conformance-cvnlfi1_sony_c: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/CVNLFI1_Sony_C.jsv |
| 262 | 262 | fate-h264-conformance-cvnlfi2_sony_h: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVNLFI2_Sony_H.jsv |
| 263 | 263 | 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 | |
| 267 | 267 | fate-h264-conformance-cvwp2_toshiba_e: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVWP2_TOSHIBA_E.264 |
| 268 | 268 | fate-h264-conformance-cvwp3_toshiba_e: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVWP3_TOSHIBA_E.264 |
| 269 | 269 | fate-h264-conformance-cvwp5_toshiba_e: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/CVWP5_TOSHIBA_E.264 |
| 270 | 270 | 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 | |
| 290 | 290 | 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 | |
| 318 | 318 | fate-h264-conformance-hcbp2_hhi_a: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/HCBP2_HHI_A.264 |
| 319 | 319 | 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 | |
| 326 | 326 | fate-h264-conformance-mr2_tandberg_e: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR2_TANDBERG_E.264 |
| 327 | 327 | fate-h264-conformance-mr3_tandberg_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR3_TANDBERG_B.264 |
| 328 | 328 | 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 | ||
| 332 | 332 | fate-h264-conformance-mr8_bt_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR8_BT_B.h264 |
| 333 | 333 | fate-h264-conformance-mr9_bt_b: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/MR9_BT_B.h264 |
| 334 | 334 | 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 | |
| 341 | 341 | fate-h264-conformance-sharp_mp_field_1_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/Sharp_MP_Field_1_B.jvt |
| 342 | 342 | fate-h264-conformance-sharp_mp_field_2_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/Sharp_MP_Field_2_B.jvt |
| 343 | 343 | fate-h264-conformance-sharp_mp_field_3_b: CMD = framecrc -vsync 0 -i $(SAMPLES)/h264-conformance/Sharp_MP_Field_3_B.jvt |
| 344 | 344 | fate-h264-conformance-sharp_mp_paff_1r2: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/Sharp_MP_PAFF_1r2.jvt |
| 345 | 345 | fate-h264-conformance-sharp_mp_paff_2r: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/Sharp_MP_PAFF_2.jvt |
| 346 | 346 | 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 | |
| 354 | 354 | |
| 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 | |
| 357 | 357 | fate-h264-extreme-plane-pred: CMD = framemd5 -strict 1 -vsync 0 -i $(SAMPLES)/h264/extreme-plane-pred.h264 |
| @@ -102,7 +102,7 @@ do_ffmpeg_crc() · 101 unmodified lines | ||
| 102 | 102 | |
| 103 | 103 | do_video_decoding() |
| 104 | 104 | { |
| 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 | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | do_video_encoding() |