[Bug 697463] New: rtpsbcdebay: incorrect frame length calculation for dual channel.
GStreamer (bugzilla.gnome.org)
bugzilla at gnome.org
Sat Apr 6 16:15:29 PDT 2013
https://bugzilla.gnome.org/show_bug.cgi?id=697463
GStreamer | gst-plugins-good | unspecified
Summary: rtpsbcdebay: incorrect frame length calculation for
dual channel.
Classification: Platform
Product: GStreamer
Version: unspecified
OS/Version: Linux
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: gst-plugins-good
AssignedTo: gstreamer-bugs at lists.freedesktop.org
ReportedBy: andreas.fenkart at streamunlimited.com
QAContact: gstreamer-bugs at lists.freedesktop.org
GNOME version: ---
Created an attachment (id=240865)
View: https://bugzilla.gnome.org/attachment.cgi?id=240865
Review: https://bugzilla.gnome.org/review?bug=697463&attachment=240865
rtpsbcdebay: incorrect frame length calculation for dual channel.
debug output in gst_rtp_sbc_depay_get_params reports this for IPad:
blocks:16 channels:2 subbands:8 bitpool:53 mode 0x02/dual channel
It seems to be wrong to multiply bitpool by number of channels.
I failed to find a proper spec clarifying that. The following RFC
has only a table about joint stereo, but not dual channel. The bitpool
values from IPad though, match those from stereo w/o joint, and these
are not multiplied by number of channels. checked by filling the numbers
http://tools.ietf.org/html/draft-ietf-payload-rtp-sbc-04#section-3
+------------------------------------------------------------+
| SBC encoder settings at Medium Quality |
+--------------------------------+-------------+-------------+
| | Mono | Joint Stereo|
| Sampling frequency (kHz) | 44.1 | 48 | 44.1 | 48 |
| Bitpool value | 19 | 18 | 35 | 33 |
| Resulting frame length (bytes) | 46 | 44 | 83 | 79 |
| Resulting bit rate (kb/s) | 127 | 132 | 229 | 237 |
+--------------------------------+------+------+------+------+
| SBC encoder settings at High Quality |
+--------------------------------+-------------+-------------+
| | Mono | Joint Stereo|
| Sampling frequency (kHz) | 44.1 | 48 | 44.1 | 48 |
| Bitpool value | 31 | 29 | 53 | 51 |
| Resulting frame length (bytes) | 70 | 66 | 119 | 115 |
| Resulting bit rate (kb/s) | 193 | 198 | 328 | 345 |
+--------------------------------+------+------+------+------+
+ Other settings: Block length = 16, loudness, subbands = 8 |
+------------------------------------------------------------+
Also pulseaudio is neither multiplying by number channels:
size_t sbc_get_frame_length(sbc_t *sbc)
{
[snip]
subbands = sbc->subbands ? 8 : 4;
blocks = 4 + (sbc->blocks * 4);
channels = sbc->mode == SBC_MODE_MONO ? 1 : 2;
joint = sbc->mode == SBC_MODE_JOINT_STEREO ? 1 : 0;
bitpool = sbc->bitpool;
ret = 4 + (4 * subbands * channels) / 8;
/* This term is not always evenly divide so we round it up */
if (channels == 1)
ret += ((blocks * channels * bitpool) + 7) / 8;
^^^^^^^^ unnecessary, since it's 1
else
ret += (((joint ? subbands : 0) + blocks * bitpool) + 7) / 8;
return ret;
}
... and audio plays perfect with the patch.
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list