This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Artifacts exist when encoding with h264 HP encoder on C6678

Hi,

     We are do encoding with h264HP encoder library(REL.100.V.H264HP.E.C6678.01.00.01.00) on C6678 platform.
If the movie clip is static pictures, the quality of compressed bitstream is acceptable. But if there's some
motion object in the movie clips, there will be some artifacts. Please refer to the attached file for it. 


I wonder if there is some bugs in the HP encoder library? or My configuration is inappropriate? What is the
possible reason?

Thanks a lot!


Sunzhao

  • Hi Sunzhao,

    Could you please share configuration file used, encoded output and if possible the input also so that we can do a detailed analysis on that.

    Thanks and regards

    Sudheesh

  • Sudheesh,

          The attached file is the cfg file used here, and another compressed bitstream generated.

    It seems that the artifacts always exist in I frames in period-I case.

    8561.encoder.cfg

    Sunzhao

  • Hi Sunzhao,

    Could you please check the same case with VBR?

    In CBR case, as I frame tries to maintain it's byte allocation to maximum picture size(to avoid overflow), QP values may be very high at that region. And HRD buffer size was low in this case. Please make the following settings(for bitrate = 5000000) to improve the condition.

    initialBufferLevel = 10000000 
    HRDBufferSize = 10000000
    qpMaxI = 36

    Thanks and regards

    Sudheesh

  • 100.V.H264HP.E.C6678.01.00, from where can i download package instead?

  • Thank you Rama, there is new pakage that not contains vc folder, I need the folder.

  • can you tell me  the linker for the pakage, or send the old pakage to my email. Look forward to you reply.

  • Sudheesh,

             With the modification you suggest, the artifacts seems a bit lighter. But it still exist.

    You may refer to the attached file for the screen capture picture, the cfg file used here,

    and the encoded file. The quality seems still unacceptable. So Is it possible to improve the

    encoding quality?

    0572.testfile.rar

    Sunzhao 

  • Hi Sunzhao,

    I could not see significant quality degradation in the output file shared by you. The text section may be a little blurred. Is that what you are referring as quality issue and artifact?

    For a resolution of 1440x900, 6mbps will be sufficient as you focus on quality. You can make

    targetBitRate           = 6000000 

    initialBufferLevel      = 12000000

    HRDBufferSize       = 12000000

    Intraframe interval is too low, as you have given only first frame as intra. But in this particular input, since lot of scene changes are there, I frames are there frequently. Otherwise you can give intraFrameInterval     = 25 or 30 as per your requirement.

    It's looks like a PC desktop is being captured and sent to encoder. We need to compare between the captured frames just before the encoder and the encoder output to assess quality. Otherwise the interface between PC and your capture device, capture settings etc will also count in the quality.

  • Hi Sudheesh,

       Please refer to the attached file for another file generated here.
    You can see clearly the quality degradation...

    5340.outfile164864560.rar

    Sunzhao

  • Hi Sunzhao,

    There is significant difference between output file currently shared and previous one.
    In this case skip frames are more and Qp is greater than 40 in web explorer scenes where we see quality degradation.

    Also it seems PRC is not enabled.

    Please share the configuration file and input yuv.

    Thanks and regards
    Sudheesh

  • Hi Sudheesh,
     
          Let me do explanation on how the compressed bitstream is generated. In our applicated scene,
    We captured the desktop real time, do rgb to yuv convertion and send the yuv data to the DSP for
    compressing. There is one trouble thing we meet now. Because the speed of capturing screen and
    rgb convertion is depended on the desktop's resolution, so it is variable. And then real frame number
    per second sent to the DSP may not equal to the setting value. For example, we set the fps to 30 in
    out cfg file, But we sent to encoder 20 frames per second. So the actual bitrate is smaller than the
    setting value. Because in the encoder side, it does'nt know the actual fps, Only do rate control with
    the setting value. Which caused the low bitrate...   Because our decoder need constant fps only.
    So we insert some skip frames into our sequance for getting constant frame rate. Our application
    running at the host PC can detect the actural frame rate automatically and make decision on whether
    or not insert one skip frame. If yes, it send on control message to DSP,and the encoder then call the
    skip frame generatting function in the encoder library. But I find the bitrate is still can not match the setting
     value. It seems that the rate control algorithm used by the H264HP encoder can not move the unused bits
    in skip frame to the real frame. And the encoded Iframe always have some lines around the slice boundry
    Then I have question below:
    1. Can I insert the skip frames anywhere in my sequence without quality degration?
    2. Can rate control logic generate constant bitrate with skip frame in the sequences
    3. I find that the Iframe's PSNR generated by the video encoder is very low(about 30), And the Pframe is
    about 40. So it seems that the quantizer value of Iframe is too large.
    4. Can you open one ftp for yuv file upload?  They have very large size.
    5. All the other configure is the same as the file upload before.
    6. Will you please feed back the quality issue to the video team, 
    And Will TI provide the update version to resolve this issue(We always see some lines near the slice boundry
    when the scene change ).
     
    We may need to improve the video quality as soon as possible ,So please help me check this.
     
    Thanks a lot!
     
    Sunzhao
  • Hi Sunzhao,

    Inserting skip frames will degarde quality.
    a)You can check with lower FPS(20-25) at encoder and see wheter that suits to your application scenario. (If you donot have high motion sequences, you can try this.)
    b)If you can tune the degree of "real-time" performance you need, you can even try for buffering 2 or 3 frames initially to get the FPS set at encoder. You can combine points (a) and (b) to see wheter that satifies your application scenario.

    How do you insert skip frames (as input toencoder) here?

    CBR allows skip frames. Encoder takes decision to skip the frame internally wrt to conditions such as VBV use level, activity of the frame, previous qp etc.
    If your bitrate is 5000000, normally we set initialBufferLevel = 1500000 and HRDBufferSize = 1500000, maintaining bitrate over 300 ms window (0.3 * bitrate for CBR and 2* bitrate for VBR). (This short window you can tune further.)

    I could not observe the line issue you told across slice boundary during scene change.. Please specify the framenumber where you observed the issue.

    Thanks and regards

    Sudheesh

  • Sudheesh,

          I am afraid that your suggestion can not meet my requirement.

    a) Because our receiver(set top box) can accept only 50fps bitstream. While we can input only 20~25 frames per second.

    So inserting skip frame is unavoid...

    b) And on the other hand, it is used in a low latency case,  we can not accept 2 or 3 frames delay. Furthermore, we use

    slice base output for cutting down the system delay.

    We just call H264HPVENC_TI_GenerateSkipFrame function for inserting one skip frame. And we set the vbv buffer to double

    of the bitrate. So can you give me suggestion on inserting skip frame in my bitstream without quality degrading..

    Thanks

    Sunzhao

     

  • Hi Sunzhao,

    Inserting skip frame may not be a good option in this case. Also it is not recommended to call directly the library function (H264HPVENC_TI_GenerateSkipFrame).

    Can you just try out with inserting previous frame again rather than making the frame skipped? In that way RC algoirthm will make most of the MBs in that block as skipped and quality will be better. In CBR case, it will make the whole frame skipped.

    Thanks and regards

    Sudheesh