changeset 2916:767156b9aa0d libavcodec

init_get_bits() requires size in bits, not bytes Patch by Steve Lhomme ||| steve | lhomme >at< free | fr |||
author rtognimp
date Wed, 19 Oct 2005 22:27:34 +0000
parents aa98fe99148e
children 4069d212f6b9
files qdm2.c
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/qdm2.c	Wed Oct 19 18:42:37 2005 +0000
+++ b/qdm2.c	Wed Oct 19 22:27:34 2005 +0000
@@ -1082,7 +1082,7 @@
     GetBitContext gb;
     int i, j, k, n, ch, run, level, diff;
 
-    init_get_bits(&gb, node->packet->data, node->packet->size);
+    init_get_bits(&gb, node->packet->data, node->packet->size*8);
 
     n = coeff_per_sb_for_avg[q->coeff_per_sb_select][QDM2_SB_USED(q->sub_sampling) - 1] + 1; // same as averagesomething function
 
@@ -1120,7 +1120,7 @@
 {
     GetBitContext gb;
 
-    init_get_bits(&gb, ((node == NULL) ? empty_buffer : node->packet->data), ((node == NULL) ? 0 : node->packet->size));
+    init_get_bits(&gb, ((node == NULL) ? empty_buffer : node->packet->data), ((node == NULL) ? 0 : node->packet->size*8));
 
     if (length != 0) {
         init_tone_level_dequantization(q, &gb, length);
@@ -1142,7 +1142,7 @@
 {
     GetBitContext gb;
 
-    init_get_bits(&gb, ((node == NULL) ? empty_buffer : node->packet->data), ((node == NULL) ? 0 : node->packet->size));
+    init_get_bits(&gb, ((node == NULL) ? empty_buffer : node->packet->data), ((node == NULL) ? 0 : node->packet->size*8));
     if (length >= 32) {
         int c = get_bits (&gb, 13);
 
@@ -1166,7 +1166,7 @@
 {
     GetBitContext gb;
 
-    init_get_bits(&gb, ((node == NULL) ? empty_buffer : node->packet->data), ((node == NULL) ? 0 : node->packet->size));
+    init_get_bits(&gb, ((node == NULL) ? empty_buffer : node->packet->data), ((node == NULL) ? 0 : node->packet->size*8));
     synthfilt_build_sb_samples(q, &gb, length, 8, QDM2_SB_USED(q->sub_sampling));
 }
 
@@ -1225,7 +1225,7 @@
 
     average_quantized_coeffs(q); // average elements in quantized_coeffs[max_ch][10][8]
 
-    init_get_bits(&gb, q->compressed_data, q->compressed_size);
+    init_get_bits(&gb, q->compressed_data, q->compressed_size*8);
     qdm2_decode_sub_packet_header(&gb, &header);
 
     if (header.type < 2 || header.type >= 8) {
@@ -1237,7 +1237,7 @@
     q->superblocktype_2_3 = (header.type == 2 || header.type == 3);
     packet_bytes = (q->compressed_size - get_bits_count(&gb) / 8);
 
-    init_get_bits(&gb, header.data, header.size);
+    init_get_bits(&gb, header.data, header.size*8);
 
     if (header.type == 2 || header.type == 4 || header.type == 5) {
         int csum = 257 * get_bits(&gb, 8) + 2 * get_bits(&gb, 8);
@@ -1267,7 +1267,7 @@
             q->sub_packet_list_A[i - 1].next = &q->sub_packet_list_A[i];
 
             /* seek to next block */
-            init_get_bits(&gb, header.data, header.size);
+            init_get_bits(&gb, header.data, header.size*8);
             skip_bits(&gb, next_index*8);
 
             if (next_index >= header.size)
@@ -1455,7 +1455,7 @@
             return;
 
         /* decode FFT tones */
-        init_get_bits (&gb, packet->data, packet->size);
+        init_get_bits (&gb, packet->data, packet->size*8);
 
         if (packet->type >= 32 && packet->type < 48 && !fft_subpackets[packet->type - 16])
             unknown_flag = 1;