1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

avcodec/vc1_block: Simplify dir_ptr / pred initialization

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
zhaoxiu.zeng 2015-02-25 00:28:45 +08:00 committed by Michael Niedermayer
parent f6b195cfb9
commit bd55f01c96

View File

@ -423,20 +423,12 @@ static inline int ff_vc1_pred_dc(MpegEncContext *s, int overlap, int pq, int n,
b = (b * s->y_dc_scale_table[q2] * ff_vc1_dqscale[dqscale_index] + 0x20000) >> 18;
}
if (a_avail && c_avail) {
if (abs(a - b) <= abs(b - c)) {
if (c_avail && (!a_avail || abs(a - b) <= abs(b - c))) {
pred = c;
*dir_ptr = 1; // left
} else {
pred = a;
*dir_ptr = 0; // top
}
} else if (a_avail) {
pred = a;
*dir_ptr = 0; // top
} else if (c_avail) {
pred = c;
*dir_ptr = 1; // left
} else {
pred = 0;
*dir_ptr = 1; // left