[xiph-commits] r9082 - experimental/derf/theora-exp/lib

tterribe at motherfish-iii.xiph.org tterribe at motherfish-iii.xiph.org
Tue Mar 22 14:53:55 PST 2005


Author: tterribe
Date: 2005-03-22 14:53:53 -0800 (Tue, 22 Mar 2005)
New Revision: 9082

Modified:
   experimental/derf/theora-exp/lib/encode.c
Log:
Fix block coded test for DC coefficient.
This should fix some severe artifacts in smooth areas at low qualities in
 scene changes.
Thanks to acolwell for the catch.


Modified: experimental/derf/theora-exp/lib/encode.c
===================================================================
--- experimental/derf/theora-exp/lib/encode.c	2005-03-18 02:30:07 UTC (rev 9081)
+++ experimental/derf/theora-exp/lib/encode.c	2005-03-22 22:53:53 UTC (rev 9082)
@@ -477,7 +477,7 @@
   _qinfo: The quantization parameters.
           These are described in more detail in theora.h.
           This can be NULL, in which case the default quantization parameters
-           will be used.
+           will be used.*
   Return: 0 on success, or a negative value on error.
           OC_FAULT if _enc is NULL.
           OC_EINVAL if the setup header has already been written, or it cannot
@@ -1839,7 +1839,7 @@
                  OC_DC_QUANT_MIN[1]>>1, but in this case those are
                  equivalent.*/
               ci=0;
-              if((unsigned)abs(dct_buf[0]-efrag->dct_coeffs[0])>
+              if((unsigned)abs(dct_buf[0]-efrag->dct_coeffs[0])<=
                OC_MAXI(efrag->tols[0],OC_DC_QUANT_MIN[0])){
                 for(ci++;ci<64;ci++){
                   if((unsigned)abs(dct_buf[ci]-efrag->dct_coeffs[ci])>
@@ -2461,15 +2461,7 @@
 static int oc_enc_init(oc_enc_ctx *_enc,const theora_info *_info){
   int ret;
   /*Initialize the shared encoder/decoder state.*/
-  if(_info->pic_width<=0||_info->pic_height<=0){
-    theora_info info;
-    memcpy(&info,_info,sizeof(info));
-    /*If the picture size is not specified, default to the rest of the frame.*/
-    if(info.pic_width<=0)info.pic_width=info.frame_width-info.pic_x;
-    if(info.pic_height<=0)info.pic_height=info.frame_height-info.pic_y;
-    ret=oc_state_init(&_enc->state,&info);
-  }
-  else ret=oc_state_init(&_enc->state,_info);
+  ret=oc_state_init(&_enc->state,_info);
   if(ret<0)return ret;
   _enc->block_coded_flags=_ogg_calloc(_enc->state.nfrags,
    sizeof(_enc->block_coded_flags[0]));



More information about the commits mailing list