how to set reference frame list especially for LTR in DXVA 2.0 RRS feed

  • Question

  • Hi all,

    In experiment of decoding bit stream with LTR (long-term reference frame) by uinsg DXVA, we found on NVIDIA card code can work well. But for ATI HD cards, there is mosaic in decoded results for decoding LTR bit stream. If there is no LTR in bitstream, there is no mosaic on ATI HD cards.

    We use following code to update reference frame list. We doubt there is some wrong in our code in setting referece frame list especially for LTR. If there is short-term and long-term reference frame together, how to set FrameNumList and other parameters? Does DXVA support multi reference frame? 

    Is the mosaic on ATI card  caused by our code or other things such as ATI driver or DXVA implementation? If you have any suggetion, please help us. thx

    for( i= 0; i < 16; i++)
          if (i < short_ref_count[0])
            // Short list reference frames
              pic = short_ref_list[0][i];
              AssociatedFlag = 0;
           else if ((i >= short_ref_count[0]) && (i < ]))
               // Long list reference frames
                pic = long_ref_list[0][i-short_ref_count[0]];
                 AssociatedFlag = 1;
              pic = NULL;

           if (pic != NULL)
                 p_DXVA_PicParams->FrameNumList[i] = pic->is_long_ref ? pic->long_term_frame_idx : pic->frame_num;
                 nUsedForReferenceFlags    |= 3<<(i*2);
                 p_DXVA_PicParams->RefFrameList[i].AssociatedFlag = AssociatedFlag;
                 p_DXVA_PicParams->RefFrameList[i].Index7Bits  = (uint8_t)pic->surface_index;
              p_DXVA_PicParams->FrameNumList[i]     = 0;
              p_DXVA_PicParams->FieldOrderCntList[i][0]   = 0;
              p_DXVA_PicParams->FieldOrderCntList[i][1]   = 0;
              p_DXVA_PicParams->RefFrameList[i].AssociatedFlag = 1;
              p_DXVA_PicParams->RefFrameList[i].Index7Bits  = 127;

     p_DXVA_PicParams->UsedForReferenceFlags = nUsedForReferenceFlags; 
     p_DXVA_PicParams->num_ref_frames = sps->num_ref_frames; // includes numbe of short and long together

    Friday, March 30, 2012 1:32 PM

All replies

  • Support for LTR is explicitly a part of the DXVA specification for H264 decoding.  Since everything seems to work fine on NVidia cards, I would suspect that there is just something wrong with the LTR processing on the other cards.  This could be limited to a specific driver version or a specific set of hardware.  DXVA is a very lightweight API, doing minimal processing in between the application and the driver -- it depends on the hardware and driver to do the right thing.
    Tuesday, April 17, 2012 7:16 PM