Skip to content

calc-cbs-params.py uses kbit/s and bytes inconsistently #25

@nmuh

Description

@nmuh

Hello,
I'm currently researching on CBS and my computations on the CBS parameters differed from the script provided in this project.
I had a look into it and found a potential bug in lines 28-29:

hicredit = math.ceil(idleslope_a * frame_non_sr / link_speed)
locredit = math.ceil(sendslope_a * max_frame_size_a / link_speed)

The variables idleslope_a, sendslope_a and linkspeed are measured in kbit/s

idleslope += int(stream['rate']) * frame_size * 8 / 1000

parser.add_argument('-S', dest='link_speed', default=1000000, type=int,
help='Link speed in kbps')

sendslope_a = idleslope_a - args.link_speed

while max_frame_size_a and frame_non_sr are in Byte (if I did not miss anything).
The usage of kbit/s and byte in one equation sounds wrong to me. Also Annex L section L.2 a) shows an example, where all computations are done in bit and bit/s.

If I missed a point somewhere in the code or the specification, I'd be thankful for pointing it out.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions