Commit 7062fad6 authored by BERO's avatar BERO Committed by Michael Niedermayer

small optimize mpeg12.c/get_qscale patch by (BERO <bero at geocities dot co...

small optimize mpeg12.c/get_qscale patch by (BERO <bero at geocities dot co dot jp>) and the return idea by arpi

Originally committed as revision 1870 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent f7a8c179
......@@ -852,16 +852,13 @@ static inline int get_dmv(MpegEncContext *s)
static inline int get_qscale(MpegEncContext *s)
{
int qscale;
int qscale = get_bits(&s->gb, 5);
if (s->mpeg2) {
if (s->q_scale_type) {
qscale = non_linear_qscale[get_bits(&s->gb, 5)];
return non_linear_qscale[qscale];
} else {
qscale = get_bits(&s->gb, 5) << 1;
return qscale << 1;
}
} else {
/* for mpeg1, we use the generic unquant code */
qscale = get_bits(&s->gb, 5);
}
return qscale;
}
......
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