From f7e5a8279dcccd01424356a91986d650a5e0db65 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Sat, 4 Jul 2009 07:19:34 -0400 Subject: ief doc: Moving allocation matrix interpolation to the "Modes" section --- doc/ietf/draft-valin-celt-codec.xml | 64 +++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 31 deletions(-) (limited to 'doc') diff --git a/doc/ietf/draft-valin-celt-codec.xml b/doc/ietf/draft-valin-celt-codec.xml index 213ba23..40c7b26 100644 --- a/doc/ietf/draft-valin-celt-codec.xml +++ b/doc/ietf/draft-valin-celt-codec.xml @@ -250,6 +250,39 @@ are mapped to MDCT bins in the same was as the energy bands. The pitch band boundaries are aligned to energy band boundaries. The definition of the pitch bands is computed in compute_pbands() (modes.c). + + +The mode contains a bit allocation table that is derived from a prototype allocation table, +specified in the band_allocation matrix (modes.c). Each row of the table is a single prototype allocation, +in bits per Bark band, and assuming 256-sample frames. These rows must be projected onto the actual band layout in use at the +current frame size and sample rate, using exact integer calculations. The reference +implementation +pre-computes these projections in compute_allocation_table() (modes.c) but implementations are free to use any +approach which produces bit-identical allocation results. + + + +Every entry in the allocation table is multiplied by the current number of channels and +the current frame size. Each prototype allocation is projected +independently using the following process: the upper band frequencies (in Hz) from the current Bark band and current CELT band are compared. (When the process begins, these will each be the first band, but will increment independently.) If the current Bark band's upper edge frequency +is less than the current CELT band's upper edge frequency, the entire value of the Bark band plus any carried remainder is assigned to the current CELT +band, and the process continues with the next +Bark band in sequence and zero remainder. If the current Bark band's upper edge frequency is equal to or greater than that of +the current CELT band, the CELT band will receive only part of this Bark band's allocation. +This portion allocated to the CELT band is then calculated by multiplying the Bark band's allocation by the +difference in Hz between the Bark band's upper frequency and the current +CELT band's lower frequency, adding the width of the current Bark band +divided by two, and then dividing this total by the width of the current Bark +band in Hz. The partial value plus any carried remainder is added to the current +CELT band, and the difference between the partial value and the Bark target is +taken as the new carried remainder. The process begins then again starting at the +next CELT band and next Bark band. Once all bands in a prototype allocation have been considered, any +remainder is added to the last CELT band. All of the resulting values are +rescaled by adding 128 and dividing by 256. + +
@@ -658,37 +691,6 @@ optimal bit allocation, it provides good results without requiring the transmission of any allocation information. - -The allocation process begins with a table of prototype allocations, -specified in band_allocation (modes.c). Each row of the table is a single prototype allocation, -in bits per Bark band. These rows must be projected onto the actual band layout in use at the -current frame size and sample rate, using exact integer calculations. The reference -implementation -pre-computes these projections in compute_allocation_table() (modes.c) but implementations are free to use any -approach which produces bit-identical allocation results. - - - -Every entry in the allocation table is multiplied by the current number of channels and -the current frame size. Each prototype allocation is projected -independently using the following process: the upper band frequencies (in Hz) from the current Bark band and current CELT band are compared. (When the process begins, these will each be the first band, but will increment independently.) If the current Bark band's upper edge frequency -is less than the current CELT band's upper edge frequency, the entire value of the Bark band plus any carried remainder is assigned to the current CELT -band, and the process begins again with the next -Bark band in sequence and zero remainder. If the current Bark band's upper edge frequency is equal to or greater than that of -the current CELT band, the CELT band will receive only part of this Bark band's allocation. -This portion allocated to the CELT band is then calculated by multiplying the Bark band's allocation by the -difference in Hz between the Bark band's upper frequency and the current -CELT band's lower frequency, adding the width of the current Bark band -divided by two, and then dividing this total by the width of the current Bark -band in Hz. The partial value plus any carried remainder is added to the current -CELT band, and the difference between the partial value and the Bark target is -taken as the new carried remainder. The process begins then again starting at the -next CELT band and next Bark band. Once all bands in a prototype allocation have been considered, any -remainder is added to the last CELT band. All of the resulting values are -rescaled by adding 128 and dividing by 256. - For every encoded or decoded frame, a target allocation must be computed -- cgit v1.2.3