Ignore:
Timestamp:
16 Nov 2013, 03:39:23 (11 years ago)
Author:
seregin
Message:

fix WP with ILR picture

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-4.0-dev/source/Lib/TLibEncoder/WeightPredAnalysis.cpp

    r486 r488  
    232232      slice->getRefPic(eRefPicList, refIdxTemp)->getSlice(0)->getWpAcDcParam(refWeightACDCParam);
    233233#if O0194_WEIGHTED_PREDICTION_CGS
    234       if (slice->getRefPic(eRefPicList, refIdxTemp)->isILR(slice->getLayerId()))
     234      UInt currLayerId = slice->getLayerId();
     235      UInt refLayerId  = slice->getRefPic(eRefPicList, refIdxTemp)->getLayerId();
     236      Bool validILRPic = slice->getRefPic(eRefPicList, refIdxTemp)->isILR( currLayerId ) && !( refLayerId == 0 && slice->getVPS()->getAvcBaseLayerFlag() );
     237
     238      if( validILRPic )
    235239      {
    236240        refWeightACDCParam = (wpACDCParam *)g_refWeightACDCParam;
     
    251255        Int64 refAC = refWeightACDCParam[comp].iAC;
    252256#if O0194_WEIGHTED_PREDICTION_CGS
    253         if (slice->getRefPic(eRefPicList, refIdxTemp)->isILR(slice->getLayerId()))
     257        if( validILRPic )
    254258        {
    255259          refAC = ( refAC * currWeightACDCParam[comp].iSamples ) /refWeightACDCParam[comp].iSamples;
    256260#if O0194_JOINT_US_BITSHIFT
    257           refAC <<= (g_bitDepthYLayer[1]-g_bitDepthYLayer[0]);
    258           refDC <<= (g_bitDepthYLayer[1]-g_bitDepthYLayer[0]);
     261          refAC <<= (g_bitDepthYLayer[currLayerId]-g_bitDepthYLayer[refLayerId]);
     262          refDC <<= (g_bitDepthYLayer[currLayerId]-g_bitDepthYLayer[refLayerId]);
    259263#endif
    260264        }
     
    266270        Int offset = (Int)( ((currDC<<log2Denom) - ((Int64)weight * refDC) + (Int64)realOffset) >> realLog2Denom );
    267271#if O0194_WEIGHTED_PREDICTION_CGS
    268         if (slice->getRefPic(eRefPicList, refIdxTemp)->isILR(slice->getLayerId()))
    269         {
    270         }
    271         else
     272        if( !validILRPic )
    272273        {
    273274          dWeight = 1;
     
    297298#if O0194_WEIGHTED_PREDICTION_CGS
    298299        // make sure the reference frames other than ILR are not using weighted prediction
    299         if (!(slice->getRefPic(eRefPicList, refIdxTemp)->isILR(slice->getLayerId())))
     300        else
     301        if( !validILRPic )
    300302        {
    301303          continue;
Note: See TracChangeset for help on using the changeset viewer.