Ticket #602: Bugifx_Ticket602.patch

File Bugifx_Ticket602.patch, 1.5 KB (added by Tanizawa, 12 years ago)
  • source/Lib/TLibCommon/TypeDef.h

     
    4040
    4141//! \ingroup TLibCommon
    4242//! \{
     43
     44#define BUGFIX_TICKET602                 1  ///< bugfix for Ticlet#602
    4345#define  TEMPORAL_ID_RESTRICTION         1  ///< I0600: Semantics of temporal_id changed
    4446#define PREVREFPIC_DEFN                    1   ///< I0345: prevRefPic defined as previous reference picture that is at same or lower
    4547                                            ///< temporal layer.
  • source/Lib/TLibEncoder/WeightPredAnalysis.cpp

     
    227227        Int64 iRefAC = RefWeightACDCParam[iComp].iAC;
    228228
    229229        // calculating iWeight and iOffset params
     230#if BUGFIX_TICKET602
     231        Double dWeight = (iRefAC==0) ? (Double)1.0 : Clip3( -256.0, 255.0, ((Double)iCurrAC / (Double)iRefAC) ); // clipped by range of wrost case (Log2WeightDenom = 0)
     232#else
    230233        Double dWeight = (iRefAC==0) ? (Double)1.0 : ( (Double)(iCurrAC) / (Double)iRefAC);
     234#endif
    231235        Int iWeight = (Int)( 0.5 + dWeight * (Double)(1<<iDenom) );
    232236        Int iOffset = (Int)( ((iCurrDC<<iDenom) - ((Int64)iWeight * iRefDC) + (Int64)iRealOffset) >> iRealDenom );
    233237