GNOME Bugzilla – Bug 613920
audioparsers: Add bitrate calculation to baseparse
Last modified: 2010-03-25 15:59:17 UTC
Created attachment 157068 [details] [review] audioparsers: Add bitrate calculation to baseparse The following patch makes baseparse keep a running average of the stream bitrate, as well as the minimum and maximum bitrates. Subclasses can define a vfunc to make sure that per-frame overhead from the container is not accounted for in the bitrate calculation. I'm also attaching patches for aacparse and flacparse which might have per-frame overhead from the container to account for.
Created attachment 157069 [details] [review] aacparse: Fix bitrate calculation
Created attachment 157073 [details] [review] flacparse: Make bitrate estimation more accurate
commit 76f5d96e064253617510b59005861159c061ffa7 Author: Arun Raghavan <arun.raghavan@collabora.co.uk> Date: Thu Mar 25 12:55:02 2010 +0000 flacparse: Make bitrate estimation more accurate This implements the get_frame_overhead() vfunc so that baseparse can make more accurate bitrate estimates. commit 599401a7f9d0f4fb59ba0cc2d3717dd0b863f132 Author: Arun Raghavan <arun.raghavan@collabora.co.uk> Date: Thu Mar 25 11:48:46 2010 +0000 aacparse: Fix bitrate calculation This patch adds the get_frame_overhead() vfunc so that baseparse can accurately calculate the min/avg/max bitrates for aacparse. Note: The bitrate was being incorrectly calculated for ADTS streams (it's not in the header as the code suggests). commit 88c1e425676745ef32cb5ccc5e9db62083e29f1f Author: Arun Raghavan <arun.raghavan@collabora.co.uk> Date: Thu Mar 25 11:22:58 2010 +0000 audioparsers: Add bitrate calculation to baseparse This makes baseparse keep a running average of the stream bitrate, as well as the minimum and maximum bitrates. Subclasses can override a vfunc to make sure that per-frame overhead from the container is not accounted for in the bitrate calculation. We take care not to override the bitrate, minimum-bitrate, and maximum-bitrate tags if they have been posted upstream. We also rate-limit the emission of bitrate so that it is only triggered by a change of >10 kbps.