X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fvp8data.h;h=a48b0f6f9b341bffd6a4cfa75fad39537200b230;hb=005c80b645cc6ab5f30cbc3e10ab66a15dfd107e;hp=ce64262758a675f83f1d9c1cd19ee512f05f7bb2;hpb=0908f1b945962f767a1b4963f9b62d8b00ffcfeb;p=ffmpeg diff --git a/libavcodec/vp8data.h b/libavcodec/vp8data.h index ce64262758a..a48b0f6f9b3 100644 --- a/libavcodec/vp8data.h +++ b/libavcodec/vp8data.h @@ -1,68 +1,35 @@ -/** - * VP8 compatible video decoder - * +/* * Copyright (C) 2010 David Conrad * Copyright (C) 2010 Ronald S. Bultje * - * This file is part of FFmpeg. + * This file is part of Libav. * - * FFmpeg is free software; you can redistribute it and/or + * Libav 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, + * Libav 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 + * License along with Libav; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -// TODO: move these #define and enum to a better header... - -#define VP8_MAX_QUANT 127 - -enum dct_token { - DCT_0, - DCT_1, - DCT_2, - DCT_3, - DCT_4, - DCT_CAT1, - DCT_CAT2, - DCT_CAT3, - DCT_CAT4, - DCT_CAT5, - DCT_CAT6, - DCT_EOB, +/** + * @file + * VP8 compatible video decoder + */ - NUM_DCT_TOKENS -}; +#ifndef AVCODEC_VP8DATA_H +#define AVCODEC_VP8DATA_H +#include "vp8.h" #include "h264pred.h" -// used to signal 4x4 intra pred in luma MBs -#define MODE_I4x4 4 - -enum inter_mvmode { - VP8_MVMODE_NEAREST = MODE_I4x4 + 1, - VP8_MVMODE_NEAR, - VP8_MVMODE_ZERO, - VP8_MVMODE_NEW, - VP8_MVMODE_SPLIT -}; - -enum inter_splitmvmode { - VP8_SPLITMVMODE_16x8 = 0, ///< 2 16x8 blocks (vertical) - VP8_SPLITMVMODE_8x16, ///< 2 8x16 blocks (horizontal) - VP8_SPLITMVMODE_8x8, ///< 2x2 blocks of 8x8px each - VP8_SPLITMVMODE_4x4, ///< 4x4 blocks of 4x4px each - VP8_SPLITMVMODE_NONE, ///< (only used in prediction) no split MVs -}; - static const uint8_t vp8_pred4x4_mode[] = { [DC_PRED8x8] = DC_PRED, @@ -293,6 +260,20 @@ static const uint8_t vp8_coeff_band[16] = 0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7 }; +/* Inverse of vp8_coeff_band: mappings of bands to coefficient indexes. + * Each list is -1-terminated. */ +static const int8_t vp8_coeff_band_indexes[8][10] = +{ + {0, -1}, + {1, -1}, + {2, -1}, + {3, -1}, + {5, -1}, + {6, -1}, + {4, 7, 8, 9, 10, 11, 12, 13, 14, -1}, + {15, -1} +}; + static const uint8_t vp8_dct_cat1_prob[] = { 159, 0 }; static const uint8_t vp8_dct_cat2_prob[] = { 165, 145, 0 }; static const uint8_t vp8_dct_cat3_prob[] = { 173, 148, 140, 0 }; @@ -301,7 +282,7 @@ static const uint8_t vp8_dct_cat5_prob[] = { 180, 157, 141, 134, 130, 0 }; static const uint8_t vp8_dct_cat6_prob[] = { 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0 }; // only used for cat3 and above; cat 1 and 2 are referenced directly -static const uint8_t * const vp8_dct_cat_prob[] = +const uint8_t * const ff_vp8_dct_cat_prob[] = { vp8_dct_cat3_prob, vp8_dct_cat4_prob, @@ -706,3 +687,5 @@ static const uint8_t vp8_mv_default_prob[2][19] = { 204, 170, 119, 235, 140, 230, 228, 128, 130, 130, 74, 148, 180, 203, 236, 254, 254 } }; + +#endif /* AVCODEC_VP8DATA_H */