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.

RTOS/TMS320DM8148: question on bit rate for h264 codec

Part Number: TMS320DM8148

Tool/software: TI-RTOS

hi,

we use REL.500.V.H264AVC.E.IVAHD.02.00.08.00 to test h264,

the default in/out fps for codec is 30/30 and we set the bit rate 4Mbps. the output is around 4Mbps

As we set in/out fps is 60/30, and the actual in fps is 60 to codec(we still set the bit rate 4Mbps), but we get 8Mbps.

why ???

Bit rate should be independent of frame rate. right ??

Is there something wrong I miss ??

  • Hello,

    Please check the codec user guide.
    You could search for VBR and CBR.


    BR
    Margarita
  • Margarita, Thanks for your reply.
    I have checked the H264_Encoder_HDVICP2_UserGuide.pdf already
    But I still can't the relationship between bit rate and frame rate. By the way, we use CBR only.

    it looks like the bps is based on 30fps, when we provide 60fps actually, it will generate twice bit rate ~~a


    Any further idea ??

  • Hello,

    Please check in the guide these params:
    initialBufferLevel
    HRDBufferSize

    These params should be :
    1⁄2*targetBitRate
    for CBR RateControl.

    You could check this thread:
    e2e.ti.com/.../1285501
    It could be in help.

    BR
    Margarita
  • Margarita, Many thanks for your remind.
    I checked provided parameters already.

    Any other idea ??
  • It looks like there's a bit rate problem as ENC's FPS are different from actual in FPS by referring to e2e.ti.com/.../381271

    I need the relationship to explain to our customer about the bit rate problem. Thanks.
  • Hi ,

    I am not sure of exact DM8148 codec , however what I know from other codec is Bitrate has to be adjusted over "n" frame that have to be encoded. So most codecs need an input  framerate to adjust there framerate over a period . Codec will not have this knowledge of what is input framerate (target framerate) and it doesn't even try to derive the same since it doesn't assume anything about frame feed timing.

    It should be handled by the system (framework around it), It should be easy to handle since it will be a dynamically configurable parameter, which can be modified with control call without recreating codec instance.

    Thanks & Regards,

    Vishwanath Patil

  • hi Vishwanath, Thanks for your sharing.

    according to my observation,

    encoder setting (actual fps:60)

    input fps     output fps     target bps       actual generated bps
    60               30                 4Mbps             8Mbps
    60               60                 4Mbps             4Mbps

    bps / out fps x actual fps = total bps
    4Mbps / 30 x 60 = 8Mbps
    the above calculation is what I guess, so I need TI's confirm if that's correct @@a. Thanks

  • Hi ,

    Actually,inputfps and outputfps are not required for Encoder.
    What encoder requires is target-framerate (30 or 60fps).


    The calculation for BR should be = ( Filesize in bits * targetframerate )/ (No of frame)

    Below is the example to get better understanding -
    ----------------------------------
    Example 1
    No of frames 300
    BR = 1Mbps

    For 30fps (10sec), FILESIZE = 1Mbps * 10 = 10Mbits
    For 60fps (5sec), FILESIZE = 1Mbps * 5 = 5Mbits

    So with target bitrate the filesize changes. If you consider same framerate to calculate BR, then it will get double.
    e.g if you consider 30fps for above condition,
    BR = 10 * 30 / 300 = 1 Mbps
    BR = 5 * 30/ 300 = 500kbps

    ----------------------------------
    Example 2
    BR = 1Mbps

    For 30fps (10sec),FILESIZE = 1Mbps * 10 = 10Mbits , No of frames should be 300
    For 60fps (10sec), FILESIZE = 1Mbps * 10 = 10Mbits , No of frames should be 600
    ----------------------------------

    I hope this will improve your understanding of frame rate and bit rate calculation.

    Regards
    Gajanan
  • Hi,
    Hope the last reply answer your query. If yes please close this thread.