[xiph-commits] r16276 - in branches/theora-thusnelda/lib/dec: . x86

tterribe at svn.xiph.org tterribe at svn.xiph.org
Tue Jul 14 04:43:52 PDT 2009


Author: tterribe
Date: 2009-07-14 04:43:52 -0700 (Tue, 14 Jul 2009)
New Revision: 16276

Modified:
   branches/theora-thusnelda/lib/dec/bitpack.c
   branches/theora-thusnelda/lib/dec/decode.c
   branches/theora-thusnelda/lib/dec/huffdec.c
   branches/theora-thusnelda/lib/dec/x86/mmxstate.c
Log:
Minor decode fix-ups that have been accumulating (to help Gumboot's education
 in svn).
A couple of nits in the new bitpacker, fix block-level QI decode (by actually
 setting the total number of coded fragments, which it needs), remove a few
 dead assignments, propagate a change from state.c to x86/mmxstate.c that got
 missed, and add a NULL check to th_decode_ycbcr_out() (though anyone not
 checking return codes will probably crash anyway trying to use the _ycbcr
 buffer that doesn't get filled in).


Modified: branches/theora-thusnelda/lib/dec/bitpack.c
===================================================================
--- branches/theora-thusnelda/lib/dec/bitpack.c	2009-07-14 10:10:58 UTC (rev 16275)
+++ branches/theora-thusnelda/lib/dec/bitpack.c	2009-07-14 11:43:52 UTC (rev 16276)
@@ -74,7 +74,7 @@
   window=_b->window;
   available=_b->bits;
   if(_bits==0)return 0;
-  if(_bits>available){
+  if(available<_bits){
     window=oc_pack_refill(_b,_bits);
     available=_b->bits;
   }

Modified: branches/theora-thusnelda/lib/dec/decode.c
===================================================================
--- branches/theora-thusnelda/lib/dec/decode.c	2009-07-14 10:10:58 UTC (rev 16275)
+++ branches/theora-thusnelda/lib/dec/decode.c	2009-07-14 11:43:52 UTC (rev 16276)
@@ -298,6 +298,7 @@
     _dec->state.ncoded_fragis[pli]=ncoded_fragis-prev_ncoded_fragis;
     prev_ncoded_fragis=ncoded_fragis;
   }
+  _dec->state.ntotal_coded_fragis=ncoded_fragis;
 }
 
 /*Decodes the bit flags indicating whether each super block is partially coded
@@ -315,7 +316,7 @@
   flag=(int)val;
   sb_flags=_dec->state.sb_flags;
   nsbs=_dec->state.nsbs;
-  sbi=run_count=npartial=0;
+  sbi=npartial=0;
   while(sbi<nsbs){
     int full_run;
     run_count=oc_sb_run_unpack(&_dec->opb);
@@ -437,6 +438,7 @@
     _dec->state.ncoded_fragis[pli]=ncoded_fragis-prev_ncoded_fragis;
     prev_ncoded_fragis=ncoded_fragis;
   }
+  _dec->state.ntotal_coded_fragis=ncoded_fragis;
   /*TODO: run_count should be 0 here.
     If it's not, we should issue a warning of some kind.*/
 }
@@ -693,7 +695,7 @@
       with the corresponding qi's for this frame.*/
     val=oc_pack_read1(&_dec->opb);
     flag=(int)val;
-    run_count=nqi1=0;
+    nqi1=0;
     fragii=0;
     while(fragii<ncoded_fragis){
       int full_run;
@@ -2148,6 +2150,7 @@
 }
 
 int th_decode_ycbcr_out(th_dec_ctx *_dec,th_ycbcr_buffer _ycbcr){
+  if(_dec==NULL||_ycbcr==NULL)return TH_EFAULT;
   oc_ycbcr_buffer_flip(_ycbcr,_dec->pp_frame_buf);
 #if defined(HAVE_CAIRO)
   /*If telemetry ioctls are active, we need to draw to the output buffer.

Modified: branches/theora-thusnelda/lib/dec/huffdec.c
===================================================================
--- branches/theora-thusnelda/lib/dec/huffdec.c	2009-07-14 10:10:58 UTC (rev 16275)
+++ branches/theora-thusnelda/lib/dec/huffdec.c	2009-07-14 11:43:52 UTC (rev 16276)
@@ -30,7 +30,7 @@
   Declaring local static versions so they can be inlined saves considerable
    function call overhead.*/
 
-static oc_pb_window inline oc_pack_refill(oc_pack_buf *_b,int _bits){
+static oc_pb_window oc_pack_refill(oc_pack_buf *_b,int _bits){
   const unsigned char *ptr;
   const unsigned char *stop;
   oc_pb_window         window;
@@ -70,15 +70,12 @@
 
 /*Advance the bit pointer.*/
 static void oc_pack_adv(oc_pack_buf *_b,int _bits){
-  oc_pb_window window;
-  window=_b->window;
   /*We ignore the special cases for _bits==0 and _bits==32 here, since they are
      never used actually used.
     OC_HUFF_SLUSH (defined below) would have to be at least 27 to actually read
      32 bits in a single go, and would require a 32 GB lookup table (assuming
      8 byte pointers, since 4 byte pointers couldn't fit such a table).*/
-  window<<=_bits;
-  _b->window=window;
+  _b->window=window<<=_bits;
   _b->bits-=_bits;
 }
 

Modified: branches/theora-thusnelda/lib/dec/x86/mmxstate.c
===================================================================
--- branches/theora-thusnelda/lib/dec/x86/mmxstate.c	2009-07-14 10:10:58 UTC (rev 16275)
+++ branches/theora-thusnelda/lib/dec/x86/mmxstate.c	2009-07-14 11:43:52 UTC (rev 16276)
@@ -76,7 +76,7 @@
   int                  ystride;
   dst_frame_data=_state->ref_frame_data[_state->ref_frame_idx[_dst_frame]];
   src_frame_data=_state->ref_frame_data[_state->ref_frame_idx[_src_frame]];
-  ystride=_state->ref_frame_bufs[0][_pli].stride;
+  ystride=_state->ref_ystride[_pli];
   frag_buf_offs=_state->frag_buf_offs;
   for(fragii=0;fragii<_nfragis;fragii++){
     ptrdiff_t frag_buf_off;



More information about the commits mailing list