1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

use h264 MC functions for rectangular blocks too

Originally committed as revision 4821 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2006-01-07 18:34:19 +00:00
parent a588a2c654
commit 2692ceab8b
3 changed files with 48 additions and 18 deletions

View File

@ -2470,11 +2470,30 @@ static void pred_block(SnowContext *s, uint8_t *dst, uint8_t *src, uint8_t *tmp,
if(block->type & BLOCK_INTRA){ if(block->type & BLOCK_INTRA){
int x, y; int x, y;
const int color = block->color[plane_index]; const int color = block->color[plane_index];
const int color4= color*0x01010101;
if(b_w==16){
for(y=0; y < b_h; y++){
*(uint32_t*)&dst[0 + y*stride]= color4;
*(uint32_t*)&dst[4 + y*stride]= color4;
*(uint32_t*)&dst[8 + y*stride]= color4;
*(uint32_t*)&dst[12+ y*stride]= color4;
}
}else if(b_w==8){
for(y=0; y < b_h; y++){
*(uint32_t*)&dst[0 + y*stride]= color4;
*(uint32_t*)&dst[4 + y*stride]= color4;
}
}else if(b_w==4){
for(y=0; y < b_h; y++){
*(uint32_t*)&dst[0 + y*stride]= color4;
}
}else{
for(y=0; y < b_h; y++){ for(y=0; y < b_h; y++){
for(x=0; x < b_w; x++){ for(x=0; x < b_w; x++){
dst[x + y*stride]= color; dst[x + y*stride]= color;
} }
} }
}
}else{ }else{
const int scale= plane_index ? s->mv_scale : 2*s->mv_scale; const int scale= plane_index ? s->mv_scale : 2*s->mv_scale;
int mx= block->mx*scale; int mx= block->mx*scale;
@ -2489,10 +2508,21 @@ static void pred_block(SnowContext *s, uint8_t *dst, uint8_t *src, uint8_t *tmp,
ff_emulated_edge_mc(tmp + MB_SIZE, src, stride, b_w+5, b_h+5, sx, sy, w, h); ff_emulated_edge_mc(tmp + MB_SIZE, src, stride, b_w+5, b_h+5, sx, sy, w, h);
src= tmp + MB_SIZE; src= tmp + MB_SIZE;
} }
if((dx&3) || (dy&3) || b_w!=b_h || (b_w!=4 && b_w!=8 && b_w!=16)) assert(b_w == b_h || 2*b_w == b_h || b_w == 2*b_h);
assert(!(b_w&(b_w-1)));
assert(b_w>1 && b_h>1);
if((dx&3) || (dy&3) || b_w==2 || b_h==2)
mc_block(dst, src, tmp, stride, b_w, b_h, dx, dy); mc_block(dst, src, tmp, stride, b_w, b_h, dx, dy);
else else if(b_w==b_h)
s->dsp.put_h264_qpel_pixels_tab[2-(b_w>>3)][dy+(dx>>2)](dst,src + 2 + 2*stride,stride); s->dsp.put_h264_qpel_pixels_tab[2-(b_w>>3)][dy+(dx>>2)](dst,src + 2 + 2*stride,stride);
else if(b_w==2*b_h){
s->dsp.put_h264_qpel_pixels_tab[2-(b_h>>3)][dy+(dx>>2)](dst ,src + 2 + 2*stride,stride);
s->dsp.put_h264_qpel_pixels_tab[2-(b_h>>3)][dy+(dx>>2)](dst+b_h,src + 2 + b_h + 2*stride,stride);
}else{
assert(2*b_w==b_h);
s->dsp.put_h264_qpel_pixels_tab[2-(b_w>>3)][dy+(dx>>2)](dst ,src + 2 + 2*stride ,stride);
s->dsp.put_h264_qpel_pixels_tab[2-(b_w>>3)][dy+(dx>>2)](dst+b_w*stride,src + 2 + 2*stride+b_w*stride,stride);
}
} }
} }

View File

@ -119,12 +119,12 @@ a7ef4746f27be309138c188e327d3ebe *./data/a-ffv1.avi
2653642 ./data/a-ffv1.avi 2653642 ./data/a-ffv1.avi
799d3db687f6cdd7a837ec156efc171f *./data/out.yuv 799d3db687f6cdd7a837ec156efc171f *./data/out.yuv
stddev: 0.00 PSNR:99.99 bytes:7602176 stddev: 0.00 PSNR:99.99 bytes:7602176
1b5f58ef86909635fa4a582eeb275118 *./data/a-snow.avi 14fa515bf25a47fc2ad3d18b726e8e31 *./data/a-snow.avi
1198432 ./data/a-snow.avi 1197138 ./data/a-snow.avi
0b96ab5415cf2d1f486a75810d033e2b *./data/out.yuv e7c746171b092266b0cf55bb5de2a40a *./data/out.yuv
stddev: 2.90 PSNR:38.87 bytes:7602176 stddev: 2.89 PSNR:38.87 bytes:7602176
de8eac1454746a37eae0b1ff88c0f849 *./data/a-snow53.avi 94bedf8929178a8202ae3b5dbcdb84dd *./data/a-snow53.avi
3535414 ./data/a-snow53.avi 3533696 ./data/a-snow53.avi
799d3db687f6cdd7a837ec156efc171f *./data/out.yuv 799d3db687f6cdd7a837ec156efc171f *./data/out.yuv
stddev: 0.00 PSNR:99.99 bytes:7602176 stddev: 0.00 PSNR:99.99 bytes:7602176
e1da20e3f52f4d2aa18e9486986161fc *./data/a-dv.dv e1da20e3f52f4d2aa18e9486986161fc *./data/a-dv.dv

View File

@ -119,12 +119,12 @@ d0831a8339491fd680b650f05262e5d9 *./data/a-ffv1.avi
3524768 ./data/a-ffv1.avi 3524768 ./data/a-ffv1.avi
dde5895817ad9d219f79a52d0bdfb001 *./data/out.yuv dde5895817ad9d219f79a52d0bdfb001 *./data/out.yuv
stddev: 0.00 PSNR:99.99 bytes:7602176 stddev: 0.00 PSNR:99.99 bytes:7602176
f5dd9e5779f7fdc0fd9f67f44fd3979b *./data/a-snow.avi b926518ac399c7af0f218a7115315b4f *./data/a-snow.avi
286706 ./data/a-snow.avi 286800 ./data/a-snow.avi
1b59f5ede351d67fc61c75a34b13ccb5 *./data/out.yuv 6c59db71d950610f854d05e2cef18609 *./data/out.yuv
stddev: 2.32 PSNR:40.79 bytes:7602176 stddev: 2.32 PSNR:40.80 bytes:7602176
d0a8bdb25d7ed641eab0debcac396eb7 *./data/a-snow53.avi 4d2bcc832e318fad3c25614e31daa6fe *./data/a-snow53.avi
2725842 ./data/a-snow53.avi 2725630 ./data/a-snow53.avi
dde5895817ad9d219f79a52d0bdfb001 *./data/out.yuv dde5895817ad9d219f79a52d0bdfb001 *./data/out.yuv
stddev: 0.00 PSNR:99.99 bytes:7602176 stddev: 0.00 PSNR:99.99 bytes:7602176
a553532dcd54c1c421b52c3b6fece6ef *./data/a-dv.dv a553532dcd54c1c421b52c3b6fece6ef *./data/a-dv.dv