Mercurial > libavcodec.hg
comparison snow.c @ 2893:6f8bcb169256 libavcodec
fix unused variable warnings
author | aurel |
---|---|
date | Wed, 21 Sep 2005 23:09:16 +0000 |
parents | 55b83c229b88 |
children | 98a2bd9c8674 |
comparison
equal
deleted
inserted
replaced
2892:41315d0120b3 | 2893:6f8bcb169256 |
---|---|
498 buf->data_stack_top = max_allocated_lines - 1; | 498 buf->data_stack_top = max_allocated_lines - 1; |
499 } | 499 } |
500 | 500 |
501 static DWTELEM * slice_buffer_load_line(slice_buffer * buf, int line) | 501 static DWTELEM * slice_buffer_load_line(slice_buffer * buf, int line) |
502 { | 502 { |
503 int i; | |
504 int offset; | 503 int offset; |
505 DWTELEM * buffer; | 504 DWTELEM * buffer; |
506 | 505 |
507 // av_log(NULL, AV_LOG_DEBUG, "Cache hit: %d\n", line); | 506 // av_log(NULL, AV_LOG_DEBUG, "Cache hit: %d\n", line); |
508 | 507 |
521 return buffer; | 520 return buffer; |
522 } | 521 } |
523 | 522 |
524 static void slice_buffer_release(slice_buffer * buf, int line) | 523 static void slice_buffer_release(slice_buffer * buf, int line) |
525 { | 524 { |
526 int i; | |
527 int offset; | 525 int offset; |
528 DWTELEM * buffer; | 526 DWTELEM * buffer; |
529 | 527 |
530 assert(line >= 0 && line < buf->line_count); | 528 assert(line >= 0 && line < buf->line_count); |
531 assert(buf->line[line]); | 529 assert(buf->line[line]); |
931 #endif | 929 #endif |
932 static void horizontal_decomposeX(DWTELEM *b, int width){ | 930 static void horizontal_decomposeX(DWTELEM *b, int width){ |
933 DWTELEM temp[width]; | 931 DWTELEM temp[width]; |
934 const int width2= width>>1; | 932 const int width2= width>>1; |
935 const int w2= (width+1)>>1; | 933 const int w2= (width+1)>>1; |
936 int A1,A2,A3,A4, x; | 934 int x; |
937 | 935 |
938 inplace_lift(b, width, COEFFS1, N1, SHIFT1, LX1, 0); | 936 inplace_lift(b, width, COEFFS1, N1, SHIFT1, LX1, 0); |
939 inplace_lift(b, width, COEFFS2, N2, SHIFT2, LX0, 0); | 937 inplace_lift(b, width, COEFFS2, N2, SHIFT2, LX0, 0); |
940 inplace_lift(b, width, COEFFS3, N3, SHIFT3, LX1, 0); | 938 inplace_lift(b, width, COEFFS3, N3, SHIFT3, LX1, 0); |
941 inplace_lift(b, width, COEFFS4, N4, SHIFT4, LX0, 0); | 939 inplace_lift(b, width, COEFFS4, N4, SHIFT4, LX0, 0); |
950 } | 948 } |
951 | 949 |
952 static void horizontal_composeX(DWTELEM *b, int width){ | 950 static void horizontal_composeX(DWTELEM *b, int width){ |
953 DWTELEM temp[width]; | 951 DWTELEM temp[width]; |
954 const int width2= width>>1; | 952 const int width2= width>>1; |
955 int A1,A2,A3,A4, x; | 953 int x; |
956 const int w2= (width+1)>>1; | 954 const int w2= (width+1)>>1; |
957 | 955 |
958 memcpy(temp, b, width*sizeof(int)); | 956 memcpy(temp, b, width*sizeof(int)); |
959 for(x=0; x<width2; x++){ | 957 for(x=0; x<width2; x++){ |
960 b[2*x ]= temp[x ]; | 958 b[2*x ]= temp[x ]; |
1008 } | 1006 } |
1009 | 1007 |
1010 static void horizontal_decompose53i(DWTELEM *b, int width){ | 1008 static void horizontal_decompose53i(DWTELEM *b, int width){ |
1011 DWTELEM temp[width]; | 1009 DWTELEM temp[width]; |
1012 const int width2= width>>1; | 1010 const int width2= width>>1; |
1013 int A1,A2,A3,A4, x; | 1011 int x; |
1014 const int w2= (width+1)>>1; | 1012 const int w2= (width+1)>>1; |
1015 | 1013 |
1016 for(x=0; x<width2; x++){ | 1014 for(x=0; x<width2; x++){ |
1017 temp[x ]= b[2*x ]; | 1015 temp[x ]= b[2*x ]; |
1018 temp[x+w2]= b[2*x + 1]; | 1016 temp[x+w2]= b[2*x + 1]; |
1019 } | 1017 } |
1020 if(width&1) | 1018 if(width&1) |
1021 temp[x ]= b[2*x ]; | 1019 temp[x ]= b[2*x ]; |
1022 #if 0 | 1020 #if 0 |
1021 { | |
1022 int A1,A2,A3,A4; | |
1023 A2= temp[1 ]; | 1023 A2= temp[1 ]; |
1024 A4= temp[0 ]; | 1024 A4= temp[0 ]; |
1025 A1= temp[0+width2]; | 1025 A1= temp[0+width2]; |
1026 A1 -= (A2 + A4)>>1; | 1026 A1 -= (A2 + A4)>>1; |
1027 A4 += (A1 + 1)>>1; | 1027 A4 += (A1 + 1)>>1; |
1045 A3= temp[width-1]; | 1045 A3= temp[width-1]; |
1046 A3 -= A2; | 1046 A3 -= A2; |
1047 A2 += (A1 + A3 + 2)>>2; | 1047 A2 += (A1 + A3 + 2)>>2; |
1048 b[width -1] = A3; | 1048 b[width -1] = A3; |
1049 b[width2-1] = A2; | 1049 b[width2-1] = A2; |
1050 } | |
1050 #else | 1051 #else |
1051 lift(b+w2, temp+w2, temp, 1, 1, 1, width, -1, 0, 1, 1, 0); | 1052 lift(b+w2, temp+w2, temp, 1, 1, 1, width, -1, 0, 1, 1, 0); |
1052 lift(b , temp , b+w2, 1, 1, 1, width, 1, 2, 2, 0, 0); | 1053 lift(b , temp , b+w2, 1, 1, 1, width, 1, 2, 2, 0, 0); |
1053 #endif | 1054 #endif |
1054 } | 1055 } |
1266 | 1267 |
1267 static void horizontal_compose53i(DWTELEM *b, int width){ | 1268 static void horizontal_compose53i(DWTELEM *b, int width){ |
1268 DWTELEM temp[width]; | 1269 DWTELEM temp[width]; |
1269 const int width2= width>>1; | 1270 const int width2= width>>1; |
1270 const int w2= (width+1)>>1; | 1271 const int w2= (width+1)>>1; |
1271 int A1,A2,A3,A4, x; | 1272 int x; |
1272 | 1273 |
1273 #if 0 | 1274 #if 0 |
1275 int A1,A2,A3,A4; | |
1274 A2= temp[1 ]; | 1276 A2= temp[1 ]; |
1275 A4= temp[0 ]; | 1277 A4= temp[0 ]; |
1276 A1= temp[0+width2]; | 1278 A1= temp[0+width2]; |
1277 A1 -= (A2 + A4)>>1; | 1279 A1 -= (A2 + A4)>>1; |
1278 A4 += (A1 + 1)>>1; | 1280 A4 += (A1 + 1)>>1; |
1450 | 1452 |
1451 static void vertical_compose97i(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, DWTELEM *b3, DWTELEM *b4, DWTELEM *b5, int width){ | 1453 static void vertical_compose97i(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, DWTELEM *b3, DWTELEM *b4, DWTELEM *b5, int width){ |
1452 int i; | 1454 int i; |
1453 | 1455 |
1454 for(i=0; i<width; i++){ | 1456 for(i=0; i<width; i++){ |
1457 #ifndef lift5 | |
1455 int r; | 1458 int r; |
1459 #endif | |
1456 b4[i] -= (W_DM*(b3[i] + b5[i])+W_DO)>>W_DS; | 1460 b4[i] -= (W_DM*(b3[i] + b5[i])+W_DO)>>W_DS; |
1457 #ifdef lift5 | 1461 #ifdef lift5 |
1458 b3[i] -= (W_CM*(b2[i] + b4[i])+W_CO)>>W_CS; | 1462 b3[i] -= (W_CM*(b2[i] + b4[i])+W_CO)>>W_CS; |
1459 #else | 1463 #else |
1460 r= 3*(b2[i] + b4[i]); | 1464 r= 3*(b2[i] + b4[i]); |
1875 } | 1879 } |
1876 } | 1880 } |
1877 | 1881 |
1878 static inline void decode_subband_slice_buffered(SnowContext *s, SubBand *b, slice_buffer * sb, int start_y, int h, int save_state[1]){ | 1882 static inline void decode_subband_slice_buffered(SnowContext *s, SubBand *b, slice_buffer * sb, int start_y, int h, int save_state[1]){ |
1879 const int w= b->width; | 1883 const int w= b->width; |
1880 int x,y; | 1884 int y; |
1881 const int qlog= clip(s->qlog + b->qlog, 0, QROOT*16); | 1885 const int qlog= clip(s->qlog + b->qlog, 0, QROOT*16); |
1882 int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT); | 1886 int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT); |
1883 int qadd= (s->qbias*qmul)>>QBIAS_SHIFT; | 1887 int qadd= (s->qbias*qmul)>>QBIAS_SHIFT; |
1884 int new_index = 0; | 1888 int new_index = 0; |
1885 | 1889 |
2581 #else | 2585 #else |
2582 { | 2586 { |
2583 | 2587 |
2584 START_TIMER | 2588 START_TIMER |
2585 | 2589 |
2586 int block_index = 0; | |
2587 for(y=0; y<b_h; y++){ | 2590 for(y=0; y<b_h; y++){ |
2588 //FIXME ugly missue of obmc_stride | 2591 //FIXME ugly missue of obmc_stride |
2589 uint8_t *obmc1= obmc + y*obmc_stride; | 2592 uint8_t *obmc1= obmc + y*obmc_stride; |
2590 uint8_t *obmc2= obmc1+ (obmc_stride>>1); | 2593 uint8_t *obmc2= obmc1+ (obmc_stride>>1); |
2591 uint8_t *obmc3= obmc1+ obmc_stride*(obmc_stride>>1); | 2594 uint8_t *obmc3= obmc1+ obmc_stride*(obmc_stride>>1); |
2906 const int w= b->width; | 2909 const int w= b->width; |
2907 const int h= b->height; | 2910 const int h= b->height; |
2908 const int qlog= clip(s->qlog + b->qlog, 0, QROOT*16); | 2911 const int qlog= clip(s->qlog + b->qlog, 0, QROOT*16); |
2909 const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT); | 2912 const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT); |
2910 int x,y, thres1, thres2; | 2913 int x,y, thres1, thres2; |
2911 START_TIMER | 2914 // START_TIMER |
2912 | 2915 |
2913 if(s->qlog == LOSSLESS_QLOG) return; | 2916 if(s->qlog == LOSSLESS_QLOG) return; |
2914 | 2917 |
2915 bias= bias ? 0 : (3*qmul)>>3; | 2918 bias= bias ? 0 : (3*qmul)>>3; |
2916 thres1= ((qmul - bias)>>QEXPSHIFT) - 1; | 2919 thres1= ((qmul - bias)>>QEXPSHIFT) - 1; |
2962 } | 2965 } |
2963 } | 2966 } |
2964 | 2967 |
2965 static void dequantize_slice_buffered(SnowContext *s, slice_buffer * sb, SubBand *b, DWTELEM *src, int stride, int start_y, int end_y){ | 2968 static void dequantize_slice_buffered(SnowContext *s, slice_buffer * sb, SubBand *b, DWTELEM *src, int stride, int start_y, int end_y){ |
2966 const int w= b->width; | 2969 const int w= b->width; |
2967 const int h= b->height; | |
2968 const int qlog= clip(s->qlog + b->qlog, 0, QROOT*16); | 2970 const int qlog= clip(s->qlog + b->qlog, 0, QROOT*16); |
2969 const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT); | 2971 const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT); |
2970 const int qadd= (s->qbias*qmul)>>QBIAS_SHIFT; | 2972 const int qadd= (s->qbias*qmul)>>QBIAS_SHIFT; |
2971 int x,y; | 2973 int x,y; |
2972 START_TIMER | 2974 START_TIMER |
3040 } | 3042 } |
3041 } | 3043 } |
3042 | 3044 |
3043 static void correlate_slice_buffered(SnowContext *s, slice_buffer * sb, SubBand *b, DWTELEM *src, int stride, int inverse, int use_median, int start_y, int end_y){ | 3045 static void correlate_slice_buffered(SnowContext *s, slice_buffer * sb, SubBand *b, DWTELEM *src, int stride, int inverse, int use_median, int start_y, int end_y){ |
3044 const int w= b->width; | 3046 const int w= b->width; |
3045 const int h= b->height; | |
3046 int x,y; | 3047 int x,y; |
3047 | 3048 |
3048 // START_TIMER | 3049 // START_TIMER |
3049 | 3050 |
3050 DWTELEM * line; | 3051 DWTELEM * line; |