aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBERO <bero@geocities.co.jp>2003-05-13 23:38:51 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-05-13 23:38:51 +0000
commit7062fad6e9e5d506f2cdaa31c75c404ccd1315ab (patch)
tree91c32c7af75153f77d15adfe80a89fdb91d131df
parentf7a8c179a7a30c25e398c7222620452ef3635fff (diff)
downloadffmpeg-7062fad6e9e5d506f2cdaa31c75c404ccd1315ab.tar.gz
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
-rw-r--r--libavcodec/mpeg12.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 7cb1592cab..3bbc843429 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -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;
}