Skip to main content

Topic: CBR or VBR - how to detect? (Read 3829 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • dand
  • [*][*][*]
CBR or VBR - how to detect?
Hi,
I have an AAC file that is being reported by the "MediaInfo" tool as VBR. How do these tools judge if AAC is CBR or VBR? How is AAC CBR different than AAC VBR, is there a limit in frame size differences accros file?

Thanks...

  • pratheekp
  • [*][*]
CBR or VBR - how to detect?
Reply #1
Hi,

    In CBR, constant bit rate mode, each frame is encoded with bits = bit_rate/sampling_rate*frame size. The use of bit reservoir allows a local variation of bits between frames. ie frames which require less bits to encode gives away its bits to encode complex portions of the music, but the bits/ channel cannot  be greater than 6144 bits as per the standard. The left over bits are used as fill bits(zero's) in order to maintain the desired rate. In case of CBR mode, we can correctly find out the file size by calculation.

But in VBR, variable bit rate ,each frame can be encoded with a max of 6144 bits/channel. Here since we do not know what can be the bits used for encoding each frame, we cannot predict the file size. Also in VBR no fill bits are used.

Hope it helps

Regards
Pratheek

  • dand
  • [*][*][*]
CBR or VBR - how to detect?
Reply #2
Hi,
I have an AAC file that is being reported by the "MediaInfo" tool as VBR. How do these tools judge if AAC is CBR or VBR? How is AAC CBR different than AAC VBR, is there a limit in frame size differences accros file?

Thanks...



Ok, here is a code snippet where MediaInfo decides on the bitrate:

Code: [Select]
void File...()
{
        if (FrameSize_Max>FrameSize_Min*1.02)
        {
            Fill(Stream_Audio, 0, Audio_BitRate_Mode, "VBR");
            Fill(Stream_Audio, 0, Audio_BitRate_Minimum, ((float64)FrameSize_Min)/1024*48000*8, 0);
            Fill(Stream_Audio, 0, Audio_BitRate_Maximum, ((float64)FrameSize_Max)/1024*48000*8, 0);
        }
        else if (Config_ParseSpeed>=1.0)
        {
            Fill(Stream_Audio, 0, Audio_BitRate_Mode, "CBR");
        }
}



Seems like they flag stream as VBR if max frame is more than 2% greater than the min frame.