#define SUBBAND_SIZE 20
#define MAX_SUBPACKETS 5
-//#define COOKDEBUG
typedef struct {
int *now;
static float pow2tab[127];
static float rootpow2tab[127];
-/* debug functions */
-
-#ifdef COOKDEBUG
-static void dump_float_table(float* table, int size, int delimiter) {
- int i=0;
- av_log(NULL,AV_LOG_ERROR,"\n[%d]: ",i);
- for (i=0 ; i<size ; i++) {
- av_log(NULL, AV_LOG_ERROR, "%5.1f, ", table[i]);
- if ((i+1)%delimiter == 0) av_log(NULL,AV_LOG_ERROR,"\n[%d]: ",i+1);
- }
-}
-
-static void dump_int_table(int* table, int size, int delimiter) {
- int i=0;
- av_log(NULL,AV_LOG_ERROR,"\n[%d]: ",i);
- for (i=0 ; i<size ; i++) {
- av_log(NULL, AV_LOG_ERROR, "%d, ", table[i]);
- if ((i+1)%delimiter == 0) av_log(NULL,AV_LOG_ERROR,"\n[%d]: ",i+1);
- }
-}
-
-static void dump_short_table(short* table, int size, int delimiter) {
- int i=0;
- av_log(NULL,AV_LOG_ERROR,"\n[%d]: ",i);
- for (i=0 ; i<size ; i++) {
- av_log(NULL, AV_LOG_ERROR, "%d, ", table[i]);
- if ((i+1)%delimiter == 0) av_log(NULL,AV_LOG_ERROR,"\n[%d]: ",i+1);
- }
-}
-
-#endif
-
/*************** init functions ***************/
/* table generator */
* Fill the gain array for the timedomain quantization.
*
* @param gb pointer to the GetBitContext
- * @param gaininfo[9] array of gain indexes
+ * @param gaininfo array[9] of gain indexes
*/
static void decode_gain_info(GetBitContext *gb, int *gaininfo)
return avctx->block_align;
}
-#ifdef COOKDEBUG
+#ifdef DEBUG
static void dump_cook_context(COOKContext *q)
{
//int i=0;
PRINT("samples_per_channel",q->subpacket[0].samples_per_channel);
PRINT("samples_per_frame",q->subpacket[0].samples_per_frame);
PRINT("subbands",q->subpacket[0].subbands);
- PRINT("random_state",q->random_state);
PRINT("js_subband_start",q->subpacket[0].js_subband_start);
PRINT("log2_numvector_size",q->subpacket[0].log2_numvector_size);
PRINT("numvector_size",q->subpacket[0].numvector_size);
default:
av_log_ask_for_sample(avctx, "Unknown Cook version.\n");
return -1;
- break;
}
if(s > 1 && q->subpacket[s].samples_per_channel != q->samples_per_channel) {
else
avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
-#ifdef COOKDEBUG
+#ifdef DEBUG
dump_cook_context(q);
#endif
return 0;