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

tterribe at motherfish-iii.xiph.org tterribe at motherfish-iii.xiph.org
Mon Aug 30 07:38:18 PDT 2004


Author: tterribe
Date: 2004-08-30 07:38:18 -0700 (Mon, 30 Aug 2004)
New Revision: 7664

Modified:
   experimental/derf/theora-exp/lib/decode.c
   experimental/derf/theora-exp/lib/encode.c
   experimental/derf/theora-exp/lib/internal.h
   experimental/derf/theora-exp/lib/state.c
Log:
Actually store the quantizer list for inter frames (the one from the previous
 intra frame was just getting re-used).

Also store PNG output with different suffixes for encoder and decoder again.


Modified: experimental/derf/theora-exp/lib/decode.c
===================================================================
--- experimental/derf/theora-exp/lib/decode.c	2004-08-30 01:40:11 UTC (rev 7663)
+++ experimental/derf/theora-exp/lib/decode.c	2004-08-30 14:38:18 UTC (rev 7664)
@@ -1871,7 +1871,7 @@
 int theora_decode_ycbcr_out(theora_dec_ctx *_dec,theora_ycbcr_buffer _ycbcr){
   oc_ycbcr_buffer_flip(_ycbcr,_dec->pp_frame_buf);
 #if defined(OC_DUMP_IMAGES)
-  oc_state_dump_frame(&_dec->state,OC_FRAME_SELF);
+  oc_state_dump_frame(&_dec->state,OC_FRAME_SELF,"dec");
 #endif
   return 0;
 }

Modified: experimental/derf/theora-exp/lib/encode.c
===================================================================
--- experimental/derf/theora-exp/lib/encode.c	2004-08-30 01:40:11 UTC (rev 7663)
+++ experimental/derf/theora-exp/lib/encode.c	2004-08-30 14:38:18 UTC (rev 7664)
@@ -2273,6 +2273,11 @@
   inter_bits+=oc_enc_coded_block_flags_pack(_enc);
   if(intra_bits>inter_bits){
     _enc->est_bits=inter_bits;
+    /*Select the quantizer list for INTER frames.*/
+    _enc->state.nqis=_enc->nqis[OC_INTER_FRAME];
+    for(qii=0;qii<_enc->state.nqis;qii++){
+      _enc->state.qis[qii]=_enc->qis[OC_INTER_FRAME][qii];
+    }
     return OC_INTER_FRAME;
   }
   /*All INTRA mode is smaller, but we haven't counted up the cost of all the
@@ -2624,7 +2629,7 @@
     /*Filter block edges.*/
     oc_state_loop_filter(&_enc->state,OC_FRAME_PREV);
 #if defined(OC_DUMP_IMAGES)
-    oc_state_dump_frame(&_enc->state,OC_FRAME_PREV);
+    oc_state_dump_frame(&_enc->state,OC_FRAME_PREV,"rec");
 #endif
     /*Fill in the borders from the reconstructed version of the last encoded
        frame.*/

Modified: experimental/derf/theora-exp/lib/internal.h
===================================================================
--- experimental/derf/theora-exp/lib/internal.h	2004-08-30 01:40:11 UTC (rev 7663)
+++ experimental/derf/theora-exp/lib/internal.h	2004-08-30 14:38:18 UTC (rev 7664)
@@ -369,7 +369,8 @@
  int _nfragis[3],int _dst_frame,int _src_frame);
 void oc_state_loop_filter(oc_theora_state *_state,int _frame);
 #if defined(OC_DUMP_IMAGES)
-int oc_state_dump_frame(const oc_theora_state *_state,int _frame);
+int oc_state_dump_frame(const oc_theora_state *_state,int _frame,
+ const char *_suf);
 #endif
 
 #endif

Modified: experimental/derf/theora-exp/lib/state.c
===================================================================
--- experimental/derf/theora-exp/lib/state.c	2004-08-30 01:40:11 UTC (rev 7663)
+++ experimental/derf/theora-exp/lib/state.c	2004-08-30 14:38:18 UTC (rev 7664)
@@ -949,7 +949,8 @@
 }
 
 #if defined(OC_DUMP_IMAGES)
-int oc_state_dump_frame(const oc_theora_state *_state,int _frame){
+int oc_state_dump_frame(const oc_theora_state *_state,int _frame,
+ const char *_suf){
   /*Dump a PNG of the reconstructed image.*/
   png_structp    png;
   png_infop      info;
@@ -976,7 +977,7 @@
   height=_state->info.height;
   iframe=_state->granpos>>_state->info.keyframe_granule_shift;
   pframe=_state->granpos-(iframe<<_state->info.keyframe_granule_shift);
-  sprintf(fname,"%08irec.png",(int)(iframe+pframe));
+  sprintf(fname,"%08i%s.png",(int)(iframe+pframe),_suf);
   fp=fopen(fname,"wb");
   if(fp==NULL)return OC_FAULT;
   image=(png_bytep *)oc_malloc_2d(height,6*width,sizeof(image[0][0]));



More information about the commits mailing list