The quantization indices for sub-bands within a group of time-blocks may then be passed to a direction index encoder 225. The direction index encoder 225 may then be configured to encode the index values on a sub-band by sub-band basis. The direction index encoder 225 thus may be configured to reduce the allocated number of bits, bits_dir1 [0:N-1 ][0:M-1 ], such that the sum of the allocated bits equals the number of available bits left after encoding the energy ratios. The reduction of the number of initially allocated bits, in other words bits_dir1 [0:N-1][0:M-1] from bits_dir0[0:N-1][0:M-1] may be implemented in some embodiments by: Firstly uniformly diminishing the number of bits across time/frequency block with an amount of bits given by the integer division between the bits to be reduced and the number of time-frequency blocks; Secondly, the bits that still need to be subtracted are subtracted one per time- frequency block starting with subband 0, time-frequency block 0. This may be implemented for example by the following c code: void only reduce bits direction (short bits_dir0 [MASA_MAXIMUM_CODING_SUBBANDS ] [MASA_SUBFRAMES ], short max bits, short reduce bits, snort coding subbands, short- no subframes, IVAS MASA (/DIRECTION * qdirection) { /* does not update the q direction structure / int j , k , bits = 0 , red_times, rem, n = 0 ; /* keep original allocation * for (j = 0 ; j < coding_subbands ; j++) { for (k = 0 ; k < no subframes; k++) { qdirection->bits_sph_idx [j] [k] = bits_dir0[j] [k] ; } } if (reduce_bits > 0 ) { red times = reduce bits / (coding subbands*no subframes); number reductions by bit * / = 0 ; j < coding_subbands ; j++) for (k = 0 ; k < no subframes; k++) { bits_dir0[j] [k] -= red_times;