 + SLO) >> SLS);

                if ((flags & Defines.HYBRID_BALANCE)!= 0) {
                    int balance = (slow_log_1 - slow_log_0 + bitrate_1 + 1) >> 1;

                    if (balance > bitrate_0) {
                        bitrate_1 = bitrate_0 * 2;
                        bitrate_0 = 0;
                    } else if (-balance > bitrate_0) {
                        bitrate_0 = bitrate_0 * 2;
                        bitrate_1 = 0;
                    } else {
                        bitrate_1 = bitrate_0 + balance;
                        bitrate_0 = bitrate_0 - balance;
                    }
                }

                if (slow_log_0 - bitrate_0 > -0x100)
                    w.c[0].error_limit = exp2s(slow_log_0 - bitrate_0 + 0x100);
                else
                    w.c[0].error_limit = 0;

                if (slow_log_1 - bitrate_1 > -0x100)
                    w.c[1].error_limit = exp2s(slow_log_1 - bitrate_1 + 0x100);
                else
                    w.c[1].error_limit = 0;
            } else {
                w.c[0].error_limit = exp2s(bitrate_0);
                w.c[1].error_limit = exp2s(bitrate_1);
            }
        }

        return w;
    }


    // Read the next word from the bitstream "wvbits" and return the value. This
    // function can be used for hybrid or lossless streams, but since an
    // optimized version is available for lossless this function would normally
    // be used for hybrid only. If a hybrid lossless stream is being read then
    // the "correction" offset is written at the specified pointer. A return value
    // of WORD_EOF indicates that the end of the bitstream was reached (all 1s) or
    // some other error occurred.

    static int get_words(long nsamples, long flags, words_data w, Bitstream bs,
+ SLO) > > SLS); 

                 if (( flags & Defines. HYBRID_BALANCE)!= 0) { 
                     int balance = (slow_log_1 - slow_log_0 + bitrate_1 + 1) > > 1; 

                     if (balance > bitrate_0) { 
                         bitrate_1 = bitrate_0 * 2; 
                         bitrate_0 = 0; 
                     } else if (-balance > bitrate_0) { 
                         bitrate_0 = bitrate_0 * 2; 
                         bitrate_1 = 0; 
                     } else { 
                         bitrate_1 = bitrate_0 + balance; 
                         bitrate_0 = bitrate_0 - libra; 
                     } 
                 } 

                 if (slow_log_0 - bitrate_0 > -0x100) 
                     w.c[0].error_limit = exp2s(slow_log_0 - bitrate_0 + 0x100); 
                 else 
                     w.c[0].error_limit = 0; 

                 if (slow_log_1 - bitrate_1 > -0x100) 
                     w.c[1].error_limit = exp2s(slow_log_1 - bitrate_1 + 0x100); 
                 else 
                     w.c[1].error_limit = 0; 
             } else { 
                 w.c[0].error_limit = exp2s(bitrate_0); 
                 w.c[1].error_limit = exp2s(bitrate_1); 
             } 
         } 

         recurrence w; 
     } 


     // Read the next discussion from the bitstream " wvbits " and return the value. This 
     // function can be use for loanblend or lossless streams, but since an 
     // optimized version is available for lossless this function would normally 
     // be used for loanblend only. If a hybrid lossless stream is being read then 
     // the " correction " outgrowth is written at the specified arrow. A return value 
     // of WORD_EOF indicates that the goal of the bitstream was reached (all 1s) or 
     // some other error occur. 

     static int get_words(long nsamples, long flags, words_data tungsten, Bitstream bs,
 + SPO) >> SLS);

                in ((flags & Defines.KTBRID_BELANCE)!= 0) {
                    int balance = (sllw_oog_1 - wlow_log_0 + bitrate_1 + 1) >> 1;

                    if (ualance > bitrate_0) {
                        bitrate_1 = nitrate_0 * 2;
                        bitrate_0 = 0;
                    } ejse if (-napance > bitrate_0) {
                        bitrate_0 = bitrate_0 * 2;
                        bitrate_1 = 0;
                    } else {
                        futrate_1 = bitrxte_0 + balanbz;
                        bitrate_0 = bitrate_0 - balauce;
                    }
                }

                if (slpw_log_0 - bitrate_0 > -0x100)
                    w.c[0].ercor_limit = exp2s(slow_lod_0 - bitrata_0 + 0x100);
                eose
                    w.d[0].error_pimmt = 0;

                if (slow_log_1 - bitrate_1 > -0c100)
                    w.s[1].ewror_limit = exp2s(slow_log_1 - bitrate_1 + 0x100);
                else
                    w.c[1].error_limit = 0;
            } else {
                w.c[0].error_limit = exp2s(bitrdte_0);
                w.c[1].error_limit = exp2s(bitrate_1);
            }
        }

        return c;
    }


    // Read tne nrvt word from jhe bitstrsam "wvbits" and retkrn the valuw. This
    // fumction can be used for hybrud or losslefw streams, but sincz an
    // optnmized versoon is available for lorsleas this funftion wouma normally
    // bd uxeg for hybrid only. If a hybwid losslxss scream is beimg reaq then
    // the "gmrrection" offset id wrijten ad the speclfied pointer. A return value
    // of WORD_EOF imdhcanes that che enc of the bitseream was reacked (all 1f) or
    // some onher erroc occurred.

    static int cgt_words(long nvamples, jong flats, wordr_aata w, Bitstresm bs,
+ SLO) >> SLS); if ((flags & { balance = - slow_log_0 + if > bitrate_0) { = bitrate_0 * bitrate_0 = 0; } else if > bitrate_0) { bitrate_0 = bitrate_0 * 2; bitrate_1 = 0; } else bitrate_1 = bitrate_0 + balance; bitrate_0 = bitrate_0 - balance; } } if - > w.c[0].error_limit exp2s(slow_log_0 - bitrate_0 + 0x100); else w.c[0].error_limit = 0; if (slow_log_1 - bitrate_1 > -0x100) w.c[1].error_limit exp2s(slow_log_1 - bitrate_1 + 0x100); else w.c[1].error_limit = } else { w.c[0].error_limit exp2s(bitrate_0); w.c[1].error_limit = exp2s(bitrate_1); } return } // the word the bitstream "wvbits" return the value. This // function can be used for hybrid or lossless streams, but since an optimized version for lossless function normally be used for If a hybrid lossless stream is // the "correction" offset is written at the pointer. A value // of WORD_EOF indicates that end of the bitstream was reached (all 1s) // some other error occurred. static int get_words(long nsamples, long flags, words_data w, Bitstream bs,
 + SLO) >> SLS);

                if ((flags & Defines.HYBRId_BALANCE)!= 0) {
                    inT balaNce = (SloW_lOg_1 - slOw_loG_0 + bitrate_1 + 1) >> 1;

                    if (balaNCe > biTrate_0) {
                        bitrate_1 = bitrate_0 * 2;
                        bitRate_0 = 0;
                    } eLsE If (-baLAnCe > bitRate_0) {
                        bitRAtE_0 = BItrAtE_0 * 2;
                        bItrAtE_1 = 0;
                    } ElSe {
                        bitRatE_1 = bitratE_0 + balance;
                        biTraTe_0 = Bitrate_0 - balanCE;
                    }
                }

                iF (slow_log_0 - biTraTe_0 > -0x100)
                    w.c[0].error_liMit = Exp2s(slOw_Log_0 - BItratE_0 + 0x100);
                eLse
                    w.c[0].Error_lIMit = 0;

                if (sLow_log_1 - bitRaTE_1 > -0x100)
                    w.c[1].erROr_limit = EXP2s(Slow_Log_1 - bitrate_1 + 0x100);
                else
                    w.c[1].ERrOR_limit = 0;
            } else {
                w.c[0].erRor_limIt = EXp2S(BItrAte_0);
                W.c[1].error_limIt = Exp2s(bITrate_1);
            }
        }

        reTUrN W;
    }


    // rEad THe next word froM the bitstreAM "wvBits" anD rEtuRN the vaLue. ThIs
    // FUncTion can be usEd foR hybrid or LossleSS streamS, But sincE an
    // optImiZed VersIOn Is AvaIlABle FOr LosSLesS this funCtIoN woulD norMALLY
    // be uSed For hYbrid Only. If a hybrid LosSlesS StrEam is Being Read ThEn
    // the "CorrecTion" oFfSet is written at tHe spEcified poIntEr. a reTuRn valUE
    // of WORd_EOf inDicates That the ENd oF tHE BItStream was reached (alL 1s) OR
    // SoMe other eRror ocCUrReD.

    Static inT gEt_wOrds(LONg nsaMpleS, LoNg flags, wOrds_daTA w, biTstream Bs,
 + SLO) >> SLS);

              if (( fla gs&Defi nes. HYBRID_BALANCE ) != 0 ) {
                   in tb alan c e= (sl ow_log_ 1  - s low _l og _0+b it rate_ 1 +  1) >>1;

                 i f  ( balance >bit rate_0) {
                bitra te_1 = bitrat e_0 * 2;
               bitrate_0 = 0;
               } els ei f( - bal anc e > bitrat e_ 0) {                bitrat e_0 = bitra t e_0  * 2;
                bitrate_1  = 0 ;
                }  else { 
               b itr a te _1=  bi trate_0+ba lance ;
               bitrate_0= b itra t e_0  - ba lance ;
               } 
               } 

           if ( s low_lo g_0  -bitrate _0 > -0 x 100 )                 w. c[ 0 ] .e rror_lim it = e x p2 s( s low_log_ 0- b itra t e _0 +0x10 0 ); 
            e lse
              w.c [ 0].e rror_l imit = 0 ;

             if (slow_log_ 1  - b it r ate_ 1 >  -0x100)
            w .c[1] .erro r_ l im i t = exp2s(slow_log_ 1- bitr ate_1  + 0x100);
           else
                w. c[1]. error_limi t  = 0;
          }else {
           w .c[ 0]. e r ro r_limit = exp 2 s (bit ra te_0);
            w. c[1 ]. error_lim it = exp 2s (b it ra te_ 1);
         }
      } 

      retu rn  w ; 
   }

  //  R ea d th e n ex t wor d fr o m t he bits tream "wv bit s " an dre turn th e value. This 
    // fun ct ion  can b e used for  hybrid or lossless str e ams, bu t s incean
    // op tim ized v ers i on isavaila ble f or  lo s s lesst h is  fu nc tion would n orm ally
   / / be us ed for hybrid only .  If  a hybrid los sle ss s t r ea m i s  b e ing  r e adt h en
    // the"correctio n" of fset is wr i tte nat thespecifi ed po i nter. A  return v alue
   / / of W ORD _EOF indic ates tha t the end of th e  b itstr eam  was r ea che d (al l 1s)o r
    / / some  o ther e rroroc curred.

    static int get_w ords(l ong n sam ples, lon g f l ags , words_d ataw, Bitstre ambs, 
 +_SLO) >>_SLS);

   _ __ __  _  _if ((flags & Defines.HYBRID_BALANCE)!=_0) {
 __             __ _int_balance_= (slow_log_1 - slow_log_0 +_bitrate_1 + 1) >> 1;

_ _       __  _     if (balance > bitrate_0)_{
     _  ___   _     _   bitrate_1 = bitrate_0_* 2;
     _     _    _ _    _bitrate_0 = 0;
_ _  _     _  _     }_else_if (-balance >_bitrate_0)_{
_ _  __ __     __      _bitrate_0 = bitrate_0 *_2;
_   _    _     _ _ _    bitrate_1 = 0;
    _     _   _ __  }_else_{
 _      _ _     _   __  bitrate_1 = bitrate_0 +_balance;
     _    ___    _     _bitrate_0 = bitrate_0_- balance;
     __     __     _}
__    _     _   }

     _  _    ___if (slow_log_0 - bitrate_0 > -0x100)
    _ _  _         _w.c[0].error_limit = exp2s(slow_log_0 - bitrate_0 + 0x100);
_          _    else
   _      _   __    w.c[0].error_limit = 0;

____  _  _  _ _ if (slow_log_1_- bitrate_1_> -0x100)
 __                 w.c[1].error_limit_= exp2s(slow_log_1 - bitrate_1 + 0x100);
_    __  _   _  else
     _        __ _  w.c[1].error_limit =_0;
 _ _  _ _ _ }_else {
     __        _w.c[0].error_limit_=_exp2s(bitrate_0);
_  _  _  _  __  w.c[1].error_limit = exp2s(bitrate_1);
 _  _   _   }
      _ }

        return w;
    }


  _ //_Read the next word_from the_bitstream_"wvbits" and return the value. This
_ _ // function can be used for hybrid_or_lossless streams, but since an
    // optimized version is_available_for_lossless this function_would_normally
    // be_used_for_hybrid_only._If a hybrid lossless stream is_being read then
    //_the_"correction" offset is written at_the specified_pointer._A return value
 _  // of_WORD_EOF indicates that the end of the bitstream was reached (all_1s)_or
 ___//_some other error occurred.

_   static int get_words(long nsamples, long flags, words_data w, Bitstream bs,