Mercurial > libavcodec.hg
comparison vp3.c @ 2687:fa86fa423e92 libavcodec
some benchmarking code
author | michael |
---|---|
date | Mon, 16 May 2005 21:49:18 +0000 |
parents | 979a847cb943 |
children | ed0ab6f82167 |
comparison
equal
deleted
inserted
replaced
2686:979a847cb943 | 2687:fa86fa423e92 |
---|---|
2316 } | 2316 } |
2317 | 2317 |
2318 for (y = 0; y < height; y++) { | 2318 for (y = 0; y < height; y++) { |
2319 | 2319 |
2320 for (x = 0; x < width; x++) { | 2320 for (x = 0; x < width; x++) { |
2321 | 2321 START_TIMER |
2322 /* do not perform left edge filter for left columns frags */ | 2322 /* do not perform left edge filter for left columns frags */ |
2323 if ((x > 0) && | 2323 if ((x > 0) && |
2324 (s->all_fragments[fragment].coding_method != MODE_COPY)) { | 2324 (s->all_fragments[fragment].coding_method != MODE_COPY)) { |
2325 horizontal_filter( | 2325 horizontal_filter( |
2326 plane_data + s->all_fragments[fragment].first_pixel - 7*stride, | 2326 plane_data + s->all_fragments[fragment].first_pixel - 7*stride, |
2356 plane_data + s->all_fragments[fragment + width].first_pixel + stride, | 2356 plane_data + s->all_fragments[fragment + width].first_pixel + stride, |
2357 stride, bounding_values); | 2357 stride, bounding_values); |
2358 } | 2358 } |
2359 | 2359 |
2360 fragment++; | 2360 fragment++; |
2361 STOP_TIMER("loop filter") | |
2361 } | 2362 } |
2362 } | 2363 } |
2363 } | 2364 } |
2364 } | 2365 } |
2365 | 2366 |
2714 } | 2715 } |
2715 | 2716 |
2716 s->current_frame.qscale_table= s->qscale_table; //FIXME allocate individual tables per AVFrame | 2717 s->current_frame.qscale_table= s->qscale_table; //FIXME allocate individual tables per AVFrame |
2717 s->current_frame.qstride= 0; | 2718 s->current_frame.qstride= 0; |
2718 | 2719 |
2720 {START_TIMER | |
2719 init_frame(s, &gb); | 2721 init_frame(s, &gb); |
2722 STOP_TIMER("init_frame")} | |
2720 | 2723 |
2721 #if KEYFRAMES_ONLY | 2724 #if KEYFRAMES_ONLY |
2722 if (!s->keyframe) { | 2725 if (!s->keyframe) { |
2723 | 2726 |
2724 memcpy(s->current_frame.data[0], s->golden_frame.data[0], | 2727 memcpy(s->current_frame.data[0], s->golden_frame.data[0], |
2729 s->current_frame.linesize[2] * s->height / 2); | 2732 s->current_frame.linesize[2] * s->height / 2); |
2730 | 2733 |
2731 } else { | 2734 } else { |
2732 #endif | 2735 #endif |
2733 | 2736 |
2734 if (unpack_superblocks(s, &gb) || | 2737 {START_TIMER |
2735 unpack_modes(s, &gb) || | 2738 if (unpack_superblocks(s, &gb)){ |
2736 unpack_vectors(s, &gb) || | 2739 av_log(s->avctx, AV_LOG_ERROR, "error in unpack_superblocks\n"); |
2737 unpack_dct_coeffs(s, &gb)) { | |
2738 | |
2739 av_log(s->avctx, AV_LOG_ERROR, " vp3: could not decode frame\n"); | |
2740 return -1; | 2740 return -1; |
2741 } | 2741 } |
2742 STOP_TIMER("unpack_superblocks")} | |
2743 {START_TIMER | |
2744 if (unpack_modes(s, &gb)){ | |
2745 av_log(s->avctx, AV_LOG_ERROR, "error in unpack_modes\n"); | |
2746 return -1; | |
2747 } | |
2748 STOP_TIMER("unpack_modes")} | |
2749 {START_TIMER | |
2750 if (unpack_vectors(s, &gb)){ | |
2751 av_log(s->avctx, AV_LOG_ERROR, "error in unpack_vectors\n"); | |
2752 return -1; | |
2753 } | |
2754 STOP_TIMER("unpack_vectors")} | |
2755 {START_TIMER | |
2756 if (unpack_dct_coeffs(s, &gb)){ | |
2757 av_log(s->avctx, AV_LOG_ERROR, "error in unpack_dct_coeffs\n"); | |
2758 return -1; | |
2759 } | |
2760 STOP_TIMER("unpack_dct_coeffs")} | |
2761 {START_TIMER | |
2742 | 2762 |
2743 reverse_dc_prediction(s, 0, s->fragment_width, s->fragment_height); | 2763 reverse_dc_prediction(s, 0, s->fragment_width, s->fragment_height); |
2764 STOP_TIMER("reverse_dc_prediction")} | |
2765 {START_TIMER | |
2744 render_fragments(s, 0, s->width, s->height, 0); | 2766 render_fragments(s, 0, s->width, s->height, 0); |
2767 STOP_TIMER("render_fragments")} | |
2745 | 2768 |
2746 if ((avctx->flags & CODEC_FLAG_GRAY) == 0) { | 2769 if ((avctx->flags & CODEC_FLAG_GRAY) == 0) { |
2747 reverse_dc_prediction(s, s->u_fragment_start, | 2770 reverse_dc_prediction(s, s->u_fragment_start, |
2748 s->fragment_width / 2, s->fragment_height / 2); | 2771 s->fragment_width / 2, s->fragment_height / 2); |
2749 reverse_dc_prediction(s, s->v_fragment_start, | 2772 reverse_dc_prediction(s, s->v_fragment_start, |
2753 } else { | 2776 } else { |
2754 memset(s->current_frame.data[1], 0x80, s->width * s->height / 4); | 2777 memset(s->current_frame.data[1], 0x80, s->width * s->height / 4); |
2755 memset(s->current_frame.data[2], 0x80, s->width * s->height / 4); | 2778 memset(s->current_frame.data[2], 0x80, s->width * s->height / 4); |
2756 } | 2779 } |
2757 | 2780 |
2781 {START_TIMER | |
2758 apply_loop_filter(s); | 2782 apply_loop_filter(s); |
2783 STOP_TIMER("apply_loop_filter")} | |
2759 #if KEYFRAMES_ONLY | 2784 #if KEYFRAMES_ONLY |
2760 } | 2785 } |
2761 #endif | 2786 #endif |
2762 | 2787 |
2763 *data_size=sizeof(AVFrame); | 2788 *data_size=sizeof(AVFrame); |