Commit 9afce7b0 authored by romansh's avatar romansh

Assign class 2 to most macroblocks by default, instead of a more conservative

method defined by SMPTE

Patch by Dan Maas


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@5074 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 8347f741
......@@ -658,8 +658,22 @@ static always_inline void dv_set_class_number(DCTELEM* blk, EncBlockInfo* bi,
const uint8_t* zigzag_scan, const int *weight, int bias)
{
int i, area;
/* We offer two different methods for class number assignment: the
method suggested in SMPTE 314M Table 22, and an improved
method. The SMPTE method is very conservative; it assigns class
3 (i.e. severe quantization) to any block where the largest AC
component is greater than 36. ffmpeg's DV encoder tracks AC bit
consumption precisely, so there is no need to bias most blocks
towards strongly lossy compression. Instead, we assign class 2
to most blocks, and use class 3 only when strictly necessary
(for blocks whose largest AC component exceeds 255). */
#if 0 /* SMPTE spec method */
static const int classes[] = {12, 24, 36, 0xffff};
int max=12;
#else /* improved ffmpeg method */
static const int classes[] = {-1, -1, 255, 0xffff};
#endif
int max=classes[0];
int prev=0;
bi->mb[0] = blk[0];
......
......@@ -133,10 +133,10 @@ stddev: 23.20 PSNR:20.81 bytes:7602176
3533710 ./data/a-snow53.avi
799d3db687f6cdd7a837ec156efc171f *./data/out.yuv
stddev: 0.00 PSNR:99.99 bytes:7602176
1352049a75c5c94f21a360888b12d75d *./data/a-dv.dv
85529d9838c5a8aef041445fa8ef3c85 *./data/a-dv.dv
7200000 ./data/a-dv.dv
2c7f745a74c1ac25566b6c49ed619649 *./data/out.yuv
stddev: 9.00 PSNR:29.03 bytes:7602176
c2082cd8adf417c4ebc32654e446cba1 *./data/out.yuv
stddev: 8.86 PSNR:29.17 bytes:7602176
bd0db310a36ad94bcd4448abe0a88368 *./data/a-svq1.mov
1379827 ./data/a-svq1.mov
bbff871d1475e1eee4231a08e075de2c *./data/out.yuv
......
......@@ -28,9 +28,9 @@ e4ed8d635d867e2f5980fd9c73c9cf3d *./data/b-libav.mov
8bf16d40a2ec19fa36b124a928e47e23 *./data/b-libav.nut
332358 ./data/b-libav.nut
./data/b-libav.nut CRC=0xccab3a27
afe55c5769eb6d1873d4106b3ef2b691 *./data/b-libav.dv
2cc647904d3cca01703f36056b9d3f42 *./data/b-libav.dv
3600000 ./data/b-libav.dv
./data/b-libav.dv CRC=0x9292dedd
./data/b-libav.dv CRC=0xa6b8b635
9a9da315747599f7718cc9a9a09c21ff *./data/b-libav.pbm
317075 ./data/b-libav.pbm
./data/b-libav.pbm CRC=0xb92906cb
......
......@@ -133,10 +133,10 @@ stddev: 10.94 PSNR:27.34 bytes:7602176
2725570 ./data/a-snow53.avi
dde5895817ad9d219f79a52d0bdfb001 *./data/out.yuv
stddev: 0.00 PSNR:99.99 bytes:7602176
3d7def2ed47e896790945c3c634fa4e8 *./data/a-dv.dv
6568326ee439099e8a0e1680336ed351 *./data/a-dv.dv
7200000 ./data/a-dv.dv
49020c3651d58137db4dc56ca13ff26d *./data/out.yuv
stddev: 3.06 PSNR:38.40 bytes:7602176
bb69dda7a84a5b166434e28e1243d3d1 *./data/out.yuv
stddev: 2.99 PSNR:38.59 bytes:7602176
5b02b6ae7ffa257a66ae9857a992fdfe *./data/a-svq1.mov
769527 ./data/a-svq1.mov
44777d1ddbccd0ef7f8d08394465670c *./data/out.yuv
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment