Commit c5706efd authored by Justin Ruggles's avatar Justin Ruggles

flacdec: remove some unused code

Originally committed as revision 16749 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent dfcb6b56
...@@ -426,21 +426,7 @@ static inline int decode_subframe(FLACContext *s, int channel) ...@@ -426,21 +426,7 @@ static inline int decode_subframe(FLACContext *s, int channel)
return -1; return -1;
} }
type = get_bits(&s->gb, 6); type = get_bits(&s->gb, 6);
// wasted = get_bits1(&s->gb);
// if (wasted)
// {
// while (!get_bits1(&s->gb))
// wasted++;
// if (wasted)
// wasted++;
// s->curr_bps -= wasted;
// }
#if 0
wasted= 16 - av_log2(show_bits(&s->gb, 17));
skip_bits(&s->gb, wasted+1);
s->curr_bps -= wasted;
#else
if (get_bits1(&s->gb)) if (get_bits1(&s->gb))
{ {
wasted = 1; wasted = 1;
...@@ -449,7 +435,7 @@ static inline int decode_subframe(FLACContext *s, int channel) ...@@ -449,7 +435,7 @@ static inline int decode_subframe(FLACContext *s, int channel)
s->curr_bps -= wasted; s->curr_bps -= wasted;
av_log(s->avctx, AV_LOG_DEBUG, "%d wasted bits\n", wasted); av_log(s->avctx, AV_LOG_DEBUG, "%d wasted bits\n", wasted);
} }
#endif
//FIXME use av_log2 for types //FIXME use av_log2 for types
if (type == 0) if (type == 0)
{ {
...@@ -533,12 +519,6 @@ static int decode_frame(FLACContext *s, int alloc_data_size) ...@@ -533,12 +519,6 @@ static int decode_frame(FLACContext *s, int alloc_data_size)
av_log(s->avctx, AV_LOG_ERROR, "utf8 fscked\n"); av_log(s->avctx, AV_LOG_ERROR, "utf8 fscked\n");
return -1; return -1;
} }
#if 0
if (/*((blocksize_code == 6) || (blocksize_code == 7)) &&*/
(s->min_blocksize != s->max_blocksize)){
}else{
}
#endif
if (blocksize_code == 0) if (blocksize_code == 0)
blocksize = s->min_blocksize; blocksize = s->min_blocksize;
...@@ -666,49 +646,6 @@ static int flac_decode_frame(AVCodecContext *avctx, ...@@ -666,49 +646,6 @@ static int flac_decode_frame(AVCodecContext *avctx,
return -1; return -1;
} }
#if 0
/* fix the channel order here */
if (s->order == MID_SIDE)
{
short *left = samples;
short *right = samples + s->blocksize;
for (i = 0; i < s->blocksize; i += 2)
{
uint32_t x = s->decoded[0][i];
uint32_t y = s->decoded[0][i+1];
right[i] = x - (y / 2);
left[i] = right[i] + y;
}
*data_size = 2 * s->blocksize;
}
else
{
for (i = 0; i < s->channels; i++)
{
switch(s->order)
{
case INDEPENDENT:
for (j = 0; j < s->blocksize; j++)
samples[(s->blocksize*i)+j] = s->decoded[i][j];
break;
case LEFT_SIDE:
case RIGHT_SIDE:
if (i == 0)
for (j = 0; j < s->blocksize; j++)
samples[(s->blocksize*i)+j] = s->decoded[0][j];
else
for (j = 0; j < s->blocksize; j++)
samples[(s->blocksize*i)+j] = s->decoded[0][j] - s->decoded[i][j];
break;
// case MID_SIDE:
// av_log(s->avctx, AV_LOG_DEBUG, "mid-side unsupported\n");
}
*data_size += s->blocksize;
}
}
#else
#define DECORRELATE(left, right)\ #define DECORRELATE(left, right)\
assert(s->channels == 2);\ assert(s->channels == 2);\
for (i = 0; i < s->blocksize; i++)\ for (i = 0; i < s->blocksize; i++)\
...@@ -736,12 +673,10 @@ static int flac_decode_frame(AVCodecContext *avctx, ...@@ -736,12 +673,10 @@ static int flac_decode_frame(AVCodecContext *avctx,
case MID_SIDE: case MID_SIDE:
DECORRELATE( (a-=b>>1) + b, a) DECORRELATE( (a-=b>>1) + b, a)
} }
#endif
*data_size = (int8_t *)samples - (int8_t *)data; *data_size = (int8_t *)samples - (int8_t *)data;
// av_log(s->avctx, AV_LOG_DEBUG, "data size: %d\n", *data_size); // av_log(s->avctx, AV_LOG_DEBUG, "data size: %d\n", *data_size);
// s->last_blocksize = s->blocksize;
end: end:
i= (get_bits_count(&s->gb)+7)/8; i= (get_bits_count(&s->gb)+7)/8;
if(i > buf_size){ if(i > buf_size){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment