/*
* VC-1 and WMV3 decoder
* Copyright (c) 2011 Mashiat Sarker Shakkhar
* 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
*/
/**
* @file
* VC-1 and WMV3 decoder
*/
#include "internal.h"
#include "dsputil.h"
#include "avcodec.h"
#include "mpegvideo.h"
#include "h263.h"
#include "vc1.h"
#include "vc1data.h"
#include "vc1acdata.h"
#include "msmpeg4data.h"
#include "unary.h"
#include "mathops.h"
#include "vdpau_internal.h"
#include "libavutil/avassert.h"
#undef NDEBUG
#include <assert.h>
#define MB_INTRA_VLC_BITS 9
#define DC_VLC_BITS 9
// offset tables for interlaced picture MVDATA decoding
static const int offset_table1[9] = { 0, 1, 2, 4, 8, 16, 32, 64, 128 };
static const int offset_table2[9] = { 0, 1, 3, 7, 15, 31, 63, 127, 255 };
/***********************************************************************/
/**
* @name VC-1 Bitplane decoding
* @see 8.7, p56
* @{
*/
/**
* Imode types
* @{
*/
enum Imode {
IMODE_RAW,
IMODE_NORM2,
IMODE_DIFF2,
IMODE_NORM6,
IMODE_DIFF6,
IMODE_ROWSKIP,
IMODE_COLSKIP
};
/** @} */ //imode defines
/** @} */ //Bitplane group
static void vc1_put_signed_blocks_clamped(VC1Context *v)
{
MpegEncContext *s = &v->s;
int topleft_mb_pos, top_mb_pos;
int stride_y, fieldtx = 0;
int v_dist;
/* The put pixels loop is always one MB row behind the decoding loop,
* because we can only put pixels when overlap filtering is done, and
* for filtering of the bottom edge of a MB, we need the next MB row
* present as well.
* Within the row, the put pixels loop is also one MB col behind the
* decoding loop. The reason for this is again, because for filtering
* of the right MB edge, we need the next MB present. */
if (!s->first_slice_line) {
if (s->mb_x) {
topleft_mb_pos = (s->mb_y - 1) * s->mb_stride + s->mb_x - 1;
if (v->fcm == ILACE_FRAME)
fieldtx = v->fieldtx_plane[topleft_mb_pos];
stride_y = s->linesize << fieldtx;
v_dist = (16 - fieldtx) >> (fieldtx == 0);
s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][0],
s->dest[0] - 16 * s->linesize - 16,
stride_y);
s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][1],
s->dest[0] - 16 * s->linesize - 8,
stride_y);
s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][2],
s->dest[0] - v_dist * s->linesize - 16,
stride_y);
s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][3],
s->dest[0] - v_dist * s->linesize - 8,
stride_y);
s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][4],
s->dest[1] - 8 * s->uvlinesize - 8,
s->uvlinesize);
s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][5],
s->dest[2] - 8 * s->uvlinesize - 8,
s->uvlinesize);
}
if (s->mb_x == s->mb_width - 1) {
top_mb_pos = (s->mb_y - 1) * s->mb_stride + s->mb_x;
if (v->fcm == ILACE_FRAME)
fieldtx = v->fieldtx_plane[top_mb_pos];
stride_y = s->linesize << fieldtx;
v_dist = fieldtx ? 15 : 8;
s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][0],
s->dest[0] - 16 * s->linesize,
stride_y);
s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][1],
s->dest[0] - 16 * s->linesize + 8,
stride_y);
s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][2],
s->dest[0] - v_dist * s->linesize,
stride_y);
s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][3],
s->dest[0] - v_dist * s->linesize + 8,
stride_y);
s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][4],
s->dest[1] - 8 * s->uvlinesize,
s->uvlinesize);
s->dsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][5],
s->dest[2] - 8 * s->uvlinesize,
s->uvlinesize);
}
}
#define inc_blk_idx(idx) do { \
idx++; \
if (idx >= v->n_allocated_blks) \
idx = 0; \
} while (0)
inc_blk_idx(v->topleft_blk_idx);
inc_blk_idx(v->top_blk_idx);
inc_blk_idx(v->left_blk_idx);
inc_blk_idx(v->cur_blk_idx);
}
static void vc1_loop_filter_iblk(VC1Context *v, int pq)
{
MpegEncContext *s = &v->s;
int j;
if (!s->first_slice_line) {
v->vc1dsp.vc1_v_loop_filter16(s->dest[0], s->linesize, pq);
if (s->mb_x)
v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 16 * s->linesize, s->linesize, pq);
v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 16 * s->linesize + 8, s->linesize, pq);
for (j = 0; j < 2; j++) {
v->vc1dsp.vc1_v_loop_filter8(s->dest[j + 1], s->uvlinesize, pq);
if (s->mb_x)
v->vc1dsp.vc1_h_loop_filter8(s->dest[j + 1] - 8 * s->uvlinesize, s->uvlinesize, pq);
}
}
v->vc1dsp.vc1_v_loop_filter16(s->dest[0] + 8 * s->linesize, s->linesize, pq);
if (s->mb_y == s->end_mb_y - 1) {
if (s->mb_x) {
v->vc1dsp.vc1_h_loop_filter16(s->dest[0], s->linesize, pq);
v->vc1dsp.vc1_h_loop_filter8(s->dest[1], s->uvlinesize, pq);
v->vc1dsp.vc1_h_loop_filter8(s->dest[2], s->uvlinesize, pq);
}
v->vc1dsp.vc1_h_loop_filter16(s->dest[0] + 8, s->linesize, pq);
}
}
static void vc1_loop_filter_iblk_delayed(VC1Context *v, int pq)
{
MpegEncContext *s = &v->s;
int j;
/* The loopfilter runs 1 row and 1 column behind the overlap filter, which
* means it runs two rows/cols behind the decoding loop. */
if (!s->first_slice_line) {
if (s->mb_x) {
if (s->mb_y >= s->start_mb_y + 2) {
v->vc1dsp.vc1_v_loop_filter16(s->dest[0] - 16 * s->linesize - 16, s->linesize, pq);
if (s->mb_x >= 2)
v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 32 * s->linesize - 16, s->linesize, pq);
v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 32 * s->linesize - 8, s->linesize, pq);
for (j = 0; j < 2; j++) {
v->vc1dsp.vc1_v_loop_filter8(s->dest[j + 1]
没有合适的资源?快使用搜索试试~ 我知道了~
MPlayer 源代码1
共2000个文件
c:2109个
h:991个
md5:314个
需积分: 5 0 下载量 120 浏览量
2023-04-22
21:54:19
上传
评论
收藏 16.97MB ZIP 举报
温馨提示
MPlayer 源代码1
资源推荐
资源详情
资源评论
收起资源包目录
MPlayer 源代码1 (2000个子文件)
vc1dec.c 227KB
h264.c 172KB
postprocess_template.c 160KB
mpegvideo_enc.c 160KB
win32.c 158KB
ffserver.c 156KB
utils.c 148KB
mplayer.c 141KB
movenc.c 141KB
vorbis_data.c 134KB
command.c 120KB
radeon_vid.c 119KB
tvi_dshow.c 117KB
mpegvideo.c 116KB
ffmpeg.c 116KB
mov.c 114KB
ffplay.c 114KB
h264_cabac.c 112KB
aacdec.c 106KB
demux_mkv.c 106KB
dsputil_vis.c 104KB
rgb2rgb_template.c 102KB
dsputil_mmx.c 101KB
dsputil.c 100KB
ffmpeg_opt.c 99KB
mpeg12.c 98KB
dcadec.c 94KB
mxfdec.c 91KB
mpeg4videodec.c 90KB
rtmpproto.c 87KB
utils.c 87KB
codec_desc.c 86KB
matroskadec.c 86KB
gl_common.c 86KB
ass_render.c 86KB
vp3.c 85KB
ac3enc.c 85KB
demux_ts.c 84KB
mxfenc.c 83KB
msmpeg4data.c 83KB
mpegaudiodsp_mips_float.c 83KB
demux_mov.c 83KB
ffprobe.c 82KB
rtsp.c 82KB
wmavoice.c 81KB
snowenc.c 80KB
g723_1.c 77KB
motion_est.c 76KB
vp8.c 76KB
x11_common.c 75KB
subreader.c 75KB
swscale_template.c 75KB
vc1.c 73KB
vf_fspp.c 73KB
ra144.c 73KB
tvi_v4l2.c 73KB
preferences.c 73KB
mpegts.c 72KB
muxer_mpeg.c 72KB
vf_fspp.c 71KB
slice.c 71KB
demux_real.c 70KB
ifo_read.c 69KB
tvi_v4l.c 68KB
mpegaudiodec.c 68KB
qdm2.c 67KB
mjpegdec.c 67KB
utils.c 67KB
simple_idct.c 66KB
diracdec.c 66KB
tiff_data.c 66KB
vorbisdec.c 65KB
mga_vid.c 64KB
wmaprodec.c 64KB
aacsbr.c 64KB
output.c 63KB
alsdec.c 63KB
demuxer.c 63KB
rv34.c 62KB
cmdutils.c 61KB
dec_teletext.c 61KB
css.c 61KB
vm.c 61KB
demux_ogg.c 61KB
ioctl.c 61KB
mpegaudiodsp_mips_fixed.c 60KB
eac3_data.c 60KB
ivi_common.c 59KB
input.c 58KB
mencoder.c 58KB
gui.c 56KB
avidec.c 55KB
m_option.c 55KB
adpcm.c 55KB
ac3dec.c 54KB
cavsdec.c 54KB
aactab.c 54KB
dsputil_altivec.c 54KB
ve_xvid4.c 53KB
vf_filmdint.c 53KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
优化大师傅
- 粉丝: 56
- 资源: 236
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功