diff options
author | Dan Maas <dmaas@maasdigital.com> | 2006-02-28 02:54:48 +0000 |
---|---|---|
committer | Roman Shaposhnik <roman@shaposhnik.org> | 2006-02-28 02:54:48 +0000 |
commit | 40116978de50c41b1e63ba6434f0d562cf173785 (patch) | |
tree | f9fb94c2fb66e03ec6de14693c0d9cf1906810d0 /libavcodec | |
parent | 49bbe394499da88e26d7bbefb23712e426b523b6 (diff) | |
download | ffmpeg-streaming-40116978de50c41b1e63ba6434f0d562cf173785.zip ffmpeg-streaming-40116978de50c41b1e63ba6434f0d562cf173785.tar.gz |
Assign class 2 to most macroblocks by default, instead of a more conservative
method defined by SMPTE
Patch by Dan Maas
Originally committed as revision 5074 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/dv.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libavcodec/dv.c b/libavcodec/dv.c index 9c31570..d4661fe 100644 --- a/libavcodec/dv.c +++ b/libavcodec/dv.c @@ -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]; |