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
This commit is contained in:
parent
f7a8c179a7
commit
7062fad6e9
@ -852,16 +852,13 @@ static inline int get_dmv(MpegEncContext *s)
|
|||||||
|
|
||||||
static inline int get_qscale(MpegEncContext *s)
|
static inline int get_qscale(MpegEncContext *s)
|
||||||
{
|
{
|
||||||
int qscale;
|
int qscale = get_bits(&s->gb, 5);
|
||||||
if (s->mpeg2) {
|
if (s->mpeg2) {
|
||||||
if (s->q_scale_type) {
|
if (s->q_scale_type) {
|
||||||
qscale = non_linear_qscale[get_bits(&s->gb, 5)];
|
return non_linear_qscale[qscale];
|
||||||
} else {
|
} 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;
|
return qscale;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user