| 1 | diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
|
|---|
| 2 | index 8784644..48fe6c6 100644
|
|---|
| 3 | --- a/libavcodec/vc1dec.c
|
|---|
| 4 | +++ b/libavcodec/vc1dec.c
|
|---|
| 5 | @@ -338,6 +338,31 @@ static void vc1_smooth_overlap_filter_iblk(VC1Context *v)
|
|---|
| 6 | }
|
|---|
| 7 | }
|
|---|
| 8 |
|
|---|
| 9 | +static int g_identity_lut_count;
|
|---|
| 10 | +static int g_non_identity_lut_count;
|
|---|
| 11 | +
|
|---|
| 12 | +static int is_identity_lut(uint8_t* lut) {
|
|---|
| 13 | + int i;
|
|---|
| 14 | + for (i = 0; i < 256; i++) {
|
|---|
| 15 | + if (lut[i] != i) {
|
|---|
| 16 | + return 0;
|
|---|
| 17 | + }
|
|---|
| 18 | + }
|
|---|
| 19 | +
|
|---|
| 20 | + return 1;
|
|---|
| 21 | +}
|
|---|
| 22 | +
|
|---|
| 23 | +static void count_lut_identity(uint8_t* lut) {
|
|---|
| 24 | + if (is_identity_lut(lut)) {
|
|---|
| 25 | + g_identity_lut_count++;
|
|---|
| 26 | + } else {
|
|---|
| 27 | + g_non_identity_lut_count++;
|
|---|
| 28 | + }
|
|---|
| 29 | +}
|
|---|
| 30 | +
|
|---|
| 31 | +static int g_vc1_mc_1mv_calls;
|
|---|
| 32 | +static int g_use_ic_times;
|
|---|
| 33 | +
|
|---|
| 34 | /** Do motion compensation over 1 macroblock
|
|---|
| 35 | * Mostly adapted hpel_motion and qpel_motion from mpegvideo.c
|
|---|
| 36 | */
|
|---|
| 37 | @@ -409,6 +434,11 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
|
|---|
| 38 | use_ic = v->next_use_ic;
|
|---|
| 39 | }
|
|---|
| 40 |
|
|---|
| 41 | + g_vc1_mc_1mv_calls++;
|
|---|
| 42 | + if (use_ic) {
|
|---|
| 43 | + g_use_ic_times++;
|
|---|
| 44 | + }
|
|---|
| 45 | +
|
|---|
| 46 | if (!srcY || !srcU) {
|
|---|
| 47 | av_log(v->s.avctx, AV_LOG_ERROR, "Referenced frame missing.\n");
|
|---|
| 48 | return;
|
|---|
| 49 | @@ -499,6 +529,13 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
|
|---|
| 50 | int i, j;
|
|---|
| 51 | uint8_t *src, *src2;
|
|---|
| 52 |
|
|---|
| 53 | + if (v->field_mode) {
|
|---|
| 54 | + count_lut_identity(luty[v->ref_field_type[dir]]);
|
|---|
| 55 | + } else {
|
|---|
| 56 | + count_lut_identity(luty[0]);
|
|---|
| 57 | + count_lut_identity(luty[1]);
|
|---|
| 58 | + }
|
|---|
| 59 | +
|
|---|
| 60 | src = srcY;
|
|---|
| 61 | for (j = 0; j < 17 + s->mspel * 2; j++) {
|
|---|
| 62 | int f = v->field_mode ? v->ref_field_type[dir] : ((j + src_y - s->mspel) & 1) ;
|
|---|
| 63 | @@ -508,6 +545,14 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
|
|---|
| 64 | }
|
|---|
| 65 | src = srcU;
|
|---|
| 66 | src2 = srcV;
|
|---|
| 67 | +
|
|---|
| 68 | + if (v->field_mode) {
|
|---|
| 69 | + count_lut_identity(lutuv[v->ref_field_type[dir]]);
|
|---|
| 70 | + } else {
|
|---|
| 71 | + count_lut_identity(lutuv[0]);
|
|---|
| 72 | + count_lut_identity(lutuv[1]);
|
|---|
| 73 | + }
|
|---|
| 74 | +
|
|---|
| 75 | for (j = 0; j < 9; j++) {
|
|---|
| 76 | int f = v->field_mode ? v->ref_field_type[dir] : ((j + uvsrc_y) & 1);
|
|---|
| 77 | for (i = 0; i < 9; i++) {
|
|---|
| 78 | @@ -5749,6 +5794,9 @@ av_cold int ff_vc1_decode_end(AVCodecContext *avctx)
|
|---|
| 79 | VC1Context *v = avctx->priv_data;
|
|---|
| 80 | int i;
|
|---|
| 81 |
|
|---|
| 82 | + av_log(NULL, AV_LOG_WARNING, "g_identity_lut_count: %d, g_non_identity_lut_count: %d\n", g_identity_lut_count, g_non_identity_lut_count);
|
|---|
| 83 | + av_log(NULL, AV_LOG_WARNING, "g_vc1_mc_1mv_calls: %d, g_use_ic_times: %d\n", g_vc1_mc_1mv_calls, g_use_ic_times);
|
|---|
| 84 | +
|
|---|
| 85 | av_frame_free(&v->sprite_output_frame);
|
|---|
| 86 |
|
|---|
| 87 | for (i = 0; i < 4; i++)
|
|---|