Revision de8e2c1d

View differences:

libavcodec/cook.c
387 387
    int exp_index2[102];
388 388
    int exp_index1[102];
389 389

  
390
    int tmp_categorize_array1[128];
391
    int tmp_categorize_array1_idx=0;
392
    int tmp_categorize_array2[128];
393
    int tmp_categorize_array2_idx=0;
394
    int category_index_size=0;
390
    int tmp_categorize_array[128*2];
391
    int tmp_categorize_array1_idx=q->numvector_size;
392
    int tmp_categorize_array2_idx=q->numvector_size;
395 393

  
396 394
    bits_left =  q->bits_per_subpacket - get_bits_count(&q->gb);
397 395

  
......
403 401

  
404 402
    memset(&exp_index1,0,102*sizeof(int));
405 403
    memset(&exp_index2,0,102*sizeof(int));
406
    memset(&tmp_categorize_array1,0,128*sizeof(int));
407
    memset(&tmp_categorize_array2,0,128*sizeof(int));
404
    memset(&tmp_categorize_array,0,128*2*sizeof(int));
408 405

  
409 406
    bias=-32;
410 407

  
......
446 443
                }
447 444
            }
448 445
            if(index==-1)break;
449
            tmp_categorize_array1[tmp_categorize_array1_idx++] = index;
446
            tmp_categorize_array[tmp_categorize_array1_idx++] = index;
450 447
            tmpbias1 -= expbits_tab[exp_index1[index]] -
451 448
                        expbits_tab[exp_index1[index]+1];
452 449
            ++exp_index1[index];
......
463 460
                }
464 461
            }
465 462
            if(index == -1)break;
466
            tmp_categorize_array2[tmp_categorize_array2_idx++] = index;
463
            tmp_categorize_array[--tmp_categorize_array2_idx] = index;
467 464
            tmpbias2 -= expbits_tab[exp_index2[index]] -
468 465
                        expbits_tab[exp_index2[index]-1];
469 466
            --exp_index2[index];
......
473 470
    for(i=0 ; i<q->total_subbands ; i++)
474 471
        category[i] = exp_index2[i];
475 472

  
476
    /* Concatenate the two arrays. */
477
    for(i=tmp_categorize_array2_idx-1 ; i >= 0; i--)
478
        category_index[category_index_size++] =  tmp_categorize_array2[i];
479

  
480
    for(i=0;i<tmp_categorize_array1_idx;i++)
481
        category_index[category_index_size++ ] =  tmp_categorize_array1[i];
482

  
483
    /* FIXME: mc_sich_ra8_20.rm triggers this, not sure with what we
484
       should fill the remaining bytes. */
485
    for(i=category_index_size;i<q->numvector_size;i++)
486
        category_index[i]=0;
473
    for(i=0 ; i<q->numvector_size-1 ; i++)
474
        category_index[i] = tmp_categorize_array[tmp_categorize_array2_idx++];
487 475

  
488 476
}
489 477

  

Also available in: Unified diff