diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-08 21:58:42 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-08 22:00:09 +0200 |
commit | d5a3caef93026abebaa73f4b9c747004a1457fd7 (patch) | |
tree | dc24d134264dcc61fd87a0a8779abf3224c0eef0 /libavcodec/vc1_pred.h | |
parent | 9da679e77fa25487ae37db11f010fde68034e362 (diff) | |
parent | 04d14c9b68b03e8dbc6e3003c1ee06892dd32576 (diff) | |
download | ffmpeg-d5a3caef93026abebaa73f4b9c747004a1457fd7.tar.gz |
Merge commit '04d14c9b68b03e8dbc6e3003c1ee06892dd32576'
* commit '04d14c9b68b03e8dbc6e3003c1ee06892dd32576':
vc1: Split the decoder in components
Conflicts:
libavcodec/Makefile
libavcodec/vc1dec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vc1_pred.h')
-rw-r--r-- | libavcodec/vc1_pred.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/libavcodec/vc1_pred.h b/libavcodec/vc1_pred.h new file mode 100644 index 0000000000..4d47f86696 --- /dev/null +++ b/libavcodec/vc1_pred.h @@ -0,0 +1,59 @@ +/* + * VC-1 and WMV3 decoder + * Copyright (c) 2006-2007 Konstantin Shishkov + * Partly based on vc9.c (c) 2005 Anonymous, Alex Beregszaszi, Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_VC1_PRED_H +#define AVCODEC_VC1_PRED_H + +#include "vc1.h" +#include "vc1data.h" + +void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y, + int mv1, int r_x, int r_y, uint8_t* is_intra, + int pred_flag, int dir); +void ff_vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y, + int mvn, int r_x, int r_y, uint8_t* is_intra, + int dir); +void ff_vc1_pred_b_mv(VC1Context *v, int dmv_x[2], int dmv_y[2], + int direct, int mvtype); +void ff_vc1_pred_b_mv_intfi(VC1Context *v, int n, int *dmv_x, int *dmv_y, + int mv1, int *pred_flag); + +static av_always_inline int scale_mv(int value, int bfrac, int inv, int qs) +{ + int n = bfrac; + +#if B_FRACTION_DEN==256 + if (inv) + n -= 256; + if (!qs) + return 2 * ((value * n + 255) >> 9); + return (value * n + 128) >> 8; +#else + if (inv) + n -= B_FRACTION_DEN; + if (!qs) + return 2 * ((value * n + B_FRACTION_DEN - 1) / (2 * B_FRACTION_DEN)); + return (value * n + B_FRACTION_DEN/2) / B_FRACTION_DEN; +#endif +} + +#endif /* AVCODEC_VC1_PRED_H */ |