# HG changeset patch # User tmmm # Date 1052310516 0 # Node ID 31d090bae36cff6dca99766a9efdf0269a18f6eb # Parent cefec170ee4648630ea02e4580377870cf347841 looking better all the time! motion compensation is starting to work diff -r cefec170ee46 -r 31d090bae36c vp3.c --- a/vp3.c Wed May 07 02:30:37 2003 +0000 +++ b/vp3.c Wed May 07 12:28:36 2003 +0000 @@ -2022,7 +2022,7 @@ int motion_x, motion_y; int motion_x_limit, motion_y_limit; int motion_halfpel_index; - unsigned char *motion_source; + unsigned int motion_source; debug_vp3(" vp3: rendering final fragments for %s\n", (plane == 0) ? "Y plane" : (plane == 1) ? "U plane" : "V plane"); @@ -2059,12 +2059,12 @@ /* transform if this block was coded */ if (s->all_fragments[i].coding_method != MODE_COPY) { -// if (s->all_fragments[i].coding_method == MODE_INTRA) { /* sort out the motion vector */ - motion_x = x + s->all_fragments[i].motion_x; - motion_y = y + s->all_fragments[i].motion_y; + motion_x = s->all_fragments[i].motion_x; + motion_y = s->all_fragments[i].motion_y; motion_halfpel_index = s->all_fragments[i].motion_halfpel_index; +/* if (motion_x < 0) motion_x = 0; @@ -2074,31 +2074,27 @@ motion_x = motion_x_limit; if (motion_y > motion_y_limit) motion_y = motion_y_limit; +*/ + motion_source = s->all_fragments[i].first_pixel; + motion_source += motion_x; + motion_source += (motion_y * stride); /* first, take care of copying a block from either the * previous or the golden frame */ if ((s->all_fragments[i].coding_method == MODE_USING_GOLDEN) || (s->all_fragments[i].coding_method == MODE_GOLDEN_MV)) { - motion_source = golden_plane; - motion_source += motion_x; - motion_source += (motion_y * -stride); - s->dsp.put_pixels_tab[1][motion_halfpel_index]( output_plane + s->all_fragments[i].first_pixel, - motion_source, + golden_plane + motion_source, stride, 8); } else if (s->all_fragments[i].coding_method != MODE_INTRA) { - motion_source = last_plane; - motion_source += motion_x; - motion_source += (motion_y * -stride); - s->dsp.put_pixels_tab[1][motion_halfpel_index]( output_plane + s->all_fragments[i].first_pixel, - motion_source, + last_plane + motion_source, stride, 8); } @@ -2110,7 +2106,6 @@ dequant_block[dequant_index[j]] = s->all_fragments[i].coeffs[j] * dequantizer[j]; - dequant_block[0] += 1024; debug_idct("dequantized block:\n"); for (m = 0; m < 8; m++) { @@ -2121,17 +2116,18 @@ } debug_idct("\n"); - /* invert DCT and place in final output */ - - if (s->all_fragments[i].coding_method == MODE_INTRA) + /* invert DCT and place (or add) in final output */ + + if (s->all_fragments[i].coding_method == MODE_INTRA) { + dequant_block[0] += 1024; s->dsp.idct_put( output_plane + s->all_fragments[i].first_pixel, stride, dequant_block); - else -// s->dsp.idct_add( - s->dsp.idct_put( + } else { + s->dsp.idct_add( output_plane + s->all_fragments[i].first_pixel, stride, dequant_block); + } debug_idct("block after idct_%s():\n", (s->all_fragments[i].coding_method == MODE_INTRA)?