mirror of
https://git.videolan.org/git/ffmpeg.git
synced 2024-09-06 08:08:58 +02:00
![Michael Niedermayer](/assets/img/avatar_default.png)
* qatar/master: vc1: export some functions configure: use HOSTCC_C/O in check_host_cc configure: use AS_O setting in check_as configure: use LD_O setting in check_ld() Revert "dsputil: make {add/put/put_signed}_pixels_clamped() non-static." build: Restore dependency of acelp_filters.o on celp_math.o celp_math: Replace duplicate ff_dot_productf() by ff_scalarproduct_c() celp_math: Move ff_cos() to the only place it is used build: Use portable abstraction for linker/hostcc output file syntax configure: Fix shared library creation for OpenBSD vp56: Don't use DECLARE_ALIGN on a typedef name mss1: move code that will be reused by MSS2 decoder into separate file mss1: merge decode_intra() and decode_inter() avprobe: Get rid of ugly casts in the options table vf_hqdn3d: Remove a duplicate inline declaration Conflicts: Makefile configure ffprobe.c libavcodec/Makefile libavcodec/amrnbdec.c libavcodec/amrwbdec.c libavcodec/celp_math.c libavcodec/celp_math.h libavcodec/dsputil.c libavcodec/lsp.c libavcodec/mss1.c libavcodec/ra288.c libavcodec/vc1dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
84 lines
2.5 KiB
C
84 lines
2.5 KiB
C
/*
|
|
* Copyright (c) 2012 Konstantin Shishkov
|
|
*
|
|
* 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
|
|
*/
|
|
|
|
/**
|
|
* @file
|
|
* Common header for Microsoft Screen 1 and 2
|
|
*/
|
|
|
|
#ifndef AVCODEC_MSS12_H
|
|
#define AVCODEC_MSS12_H
|
|
|
|
#include "avcodec.h"
|
|
#include "get_bits.h"
|
|
|
|
#define MODEL_MIN_SYMS 2
|
|
#define MODEL_MAX_SYMS 256
|
|
#define THRESH_ADAPTIVE -1
|
|
#define THRESH_LOW 15
|
|
#define THRESH_HIGH 50
|
|
|
|
typedef struct Model {
|
|
int cum_prob[MODEL_MAX_SYMS + 1];
|
|
int weights[MODEL_MAX_SYMS + 1];
|
|
int idx2sym[MODEL_MAX_SYMS + 1];
|
|
int sym2idx[MODEL_MAX_SYMS + 1];
|
|
int num_syms;
|
|
int thr_weight, threshold;
|
|
} Model;
|
|
|
|
typedef struct ArithCoder {
|
|
int low, high, value;
|
|
GetBitContext *gb;
|
|
int (*get_model_sym)(struct ArithCoder *c, Model *m);
|
|
int (*get_number) (struct ArithCoder *c, int n);
|
|
} ArithCoder;
|
|
|
|
typedef struct PixContext {
|
|
int cache_size, num_syms;
|
|
uint8_t cache[12];
|
|
Model cache_model, full_model;
|
|
Model sec_models[4][8][4];
|
|
} PixContext;
|
|
|
|
typedef struct MSS12Context {
|
|
AVCodecContext *avctx;
|
|
uint8_t *pic_start;
|
|
int pic_stride;
|
|
uint8_t *mask;
|
|
int mask_linesize;
|
|
uint32_t pal[256];
|
|
int free_colours;
|
|
int keyframe;
|
|
Model intra_region, inter_region;
|
|
Model pivot, edge_mode, split_mode;
|
|
PixContext intra_pix_ctx, inter_pix_ctx;
|
|
int corrupted;
|
|
} MSS12Context;
|
|
|
|
int ff_mss12_decode_rect(MSS12Context *ctx, ArithCoder *acoder,
|
|
int x, int y, int width, int height);
|
|
void ff_mss12_model_update(Model *m, int val);
|
|
void ff_mss12_codec_reset(MSS12Context *ctx);
|
|
av_cold int ff_mss12_decode_init(AVCodecContext *avctx, int version);
|
|
av_cold int ff_mss12_decode_end(AVCodecContext *avctx);
|
|
|
|
#endif /* AVCODEC_MSS12_H */
|