/*
* motion_comp_vis.c
* Copyright (C) 2003 David S. Miller <davem@redhat.com>
*
* This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
* See http://libmpeg2.sourceforge.net/ for updates.
*
* mpeg2dec is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* mpeg2dec 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#ifdef ARCH_SPARC
#include <inttypes.h>
#include "mpeg2.h"
#include "attributes.h"
#include "mpeg2_internal.h"
#include "vis.h"
/* The trick used in some of this file is the formula from the MMX
* motion comp code, which is:
*
* (x+y+1)>>1 == (x|y)-((x^y)>>1)
*
* This allows us to average 8 bytes at a time in a 64-bit FPU reg.
* We avoid overflows by masking before we do the shift, and we
* implement the shift by multiplying by 1/2 using mul8x16. So in
* VIS this is (assume 'x' is in f0, 'y' is in f2, a repeating mask
* of '0xfe' is in f4, a repeating mask of '0x7f' is in f6, and
* the value 0x80808080 is in f8):
*
* fxor f0, f2, f10
* fand f10, f4, f10
* fmul8x16 f8, f10, f10
* fand f10, f6, f10
* for f0, f2, f12
* fpsub16 f12, f10, f10
*/
#define DUP4(x) {x, x, x, x}
#define DUP8(x) {x, x, x, x, x, x, x, x}
static const int16_t constants1[] ATTR_ALIGN(8) = DUP4 (1);
static const int16_t constants2[] ATTR_ALIGN(8) = DUP4 (2);
static const int16_t constants3[] ATTR_ALIGN(8) = DUP4 (3);
static const int16_t constants6[] ATTR_ALIGN(8) = DUP4 (6);
static const int8_t constants_fe[] ATTR_ALIGN(8) = DUP8 (0xfe);
static const int8_t constants_7f[] ATTR_ALIGN(8) = DUP8 (0x7f);
static const int8_t constants128[] ATTR_ALIGN(8) = DUP8 (128);
static const int16_t constants256_512[] ATTR_ALIGN(8) =
{256, 512, 256, 512};
static const int16_t constants256_1024[] ATTR_ALIGN(8) =
{256, 1024, 256, 1024};
#define REF_0 0
#define REF_0_1 1
#define REF_2 2
#define REF_2_1 3
#define REF_4 4
#define REF_4_1 5
#define REF_6 6
#define REF_6_1 7
#define REF_S0 8
#define REF_S0_1 9
#define REF_S2 10
#define REF_S2_1 11
#define REF_S4 12
#define REF_S4_1 13
#define REF_S6 14
#define REF_S6_1 15
#define DST_0 16
#define DST_1 17
#define DST_2 18
#define DST_3 19
#define CONST_1 20
#define CONST_2 20
#define CONST_3 20
#define CONST_6 20
#define MASK_fe 20
#define CONST_128 22
#define CONST_256 22
#define CONST_512 22
#define CONST_1024 22
#define TMP0 24
#define TMP1 25
#define TMP2 26
#define TMP3 27
#define TMP4 28
#define TMP5 29
#define ZERO 30
#define MASK_7f 30
#define TMP6 32
#define TMP8 34
#define TMP10 36
#define TMP12 38
#define TMP14 40
#define TMP16 42
#define TMP18 44
#define TMP20 46
#define TMP22 48
#define TMP24 50
#define TMP26 52
#define TMP28 54
#define TMP30 56
#define TMP32 58
static void MC_put_o_16_vis (uint8_t * dest, const uint8_t * _ref,
const int stride, int height)
{
uint8_t *ref = (uint8_t *) _ref;
int offset;
ref = vis_alignaddr(ref);
offset = (ref != _ref) ? 16 : 0;
do { /* 5 cycles */
vis_ld64(ref[0], TMP0);
vis_ld64_2(ref, 8, TMP2);
vis_ld64_2(ref, offset, TMP4);
ref += stride;
vis_faligndata(TMP0, TMP2, REF_0);
vis_st64(REF_0, dest[0]);
vis_faligndata(TMP2, TMP4, REF_2);
vis_st64_2(REF_2, dest, 8);
dest += stride;
} while (--height);
}
static void MC_put_o_8_vis (uint8_t * dest, const uint8_t * _ref,
const int stride, int height)
{
uint8_t *ref = (uint8_t *) _ref;
int offset;
ref = vis_alignaddr(ref);
offset = (ref != _ref) ? 8 : 0;
do { /* 4 cycles */
vis_ld64(ref[0], TMP0);
vis_ld64_2(ref, offset, TMP2);
ref += stride;
/* stall */
vis_faligndata(TMP0, TMP2, REF_0);
vis_st64(REF_0, dest[0]);
dest += stride;
} while (--height);
}
static void MC_avg_o_16_vis (uint8_t * dest, const uint8_t * _ref,
const int stride, int height)
{
uint8_t *ref = (uint8_t *) _ref;
int stride_8 = stride + 8;
int offset;
ref = vis_alignaddr(ref);
offset = (ref != _ref) ? 16 : 0;
vis_ld64(ref[0], TMP0);
vis_ld64(ref[8], TMP2);
vis_ld64_2(ref, offset, TMP4);
vis_ld64(dest[0], DST_0);
vis_ld64(dest[8], DST_2);
vis_ld64(constants_fe[0], MASK_fe);
vis_faligndata(TMP0, TMP2, REF_0);
vis_ld64(constants_7f[0], MASK_7f);
vis_faligndata(TMP2, TMP4, REF_2);
vis_ld64(constants128[0], CONST_128);
ref += stride;
height = (height >> 1) - 1;
do { /* 24 cycles */
vis_ld64(ref[0], TMP0);
vis_xor(DST_0, REF_0, TMP6);
vis_ld64_2(ref, 8, TMP2);
vis_and(TMP6, MASK_fe, TMP6);
vis_ld64_2(ref, offset, TMP4);
ref += stride;
vis_mul8x16(CONST_128, TMP6, TMP6);
vis_xor(DST_2, REF_2, TMP8);
vis_and(TMP8, MASK_fe, TMP8);
vis_or(DST_0, REF_0, TMP10);
vis_ld64_2(dest, stride, DST_0);
vis_mul8x16(CONST_128, TMP8, TMP8);
vis_or(DST_2, REF_2, TMP12);
vis_ld64_2(dest, stride_8, DST_2);
vis_ld64(ref[0], TMP14);
vis_and(TMP6, MASK_7f, TMP6);
vis_and(TMP8, MASK_7f, TMP8);
vis_psub16(TMP10, TMP6, TMP6);
vis_st64(TMP6, dest[0]);
vis_psub16(TMP12, TMP8, TMP8);
vis_st64_2(TMP8, dest, 8);
dest += stride;
vis_ld64_2(ref, 8, TMP16);
vis_faligndata(TMP0, TMP2, REF_0);
vis_ld64_2(ref, offset, TMP18);
vis_faligndata(TMP2, TMP4, REF_2);
ref += stride;
vis_xor(DST_0, REF_0, TMP20);
vis_and(TMP20, MASK_fe, TMP20);
vis_xor(DST_2, REF_2, TMP22);
vis_mul8x16(CONST_128, TMP20, TMP20);
vis_and(TMP22, MASK_fe, TMP22);
vis_or(DST_0, REF_0, TMP24);
vis_mul8x16(CONST_128, TMP22, TMP22);
vis_or(DST_2, REF_2, TMP26);
vis_ld64_2(dest, stride, DST_0);
vis_faligndata(TMP14, TMP16, REF_0);
vis_ld64_2(dest, stride_8, DST_2);
vis_faligndata(TMP16, TMP18, REF_2);
vis_and(TMP20, MASK_7f, TMP20);
vis_and(TMP22, MASK_7f, TMP22);
vis_psub16(TMP24, TMP20, TMP20);
vis_st64(TMP20, dest[0]);
vis_psub16(TMP26, TMP22, TMP22);
vis_st64_2(TMP22, dest, 8);
dest += stride;
} while (--height);
vis_ld64(ref[0], TMP0);
vis_xor(DST_0, REF_0, TMP6);
vis_ld64_2(ref, 8, TMP2);
vis_and(TMP6, MASK_fe, TMP6);
vis_ld64_2(ref, offset, TMP4);
vis_mul8x16(CONST_128, TMP6, TMP6);
vis_xor(DST_2, REF_2, TMP8);
vis_and(TMP8, MASK_fe, TMP8);
vis_or(DST_0, REF_0, TMP10);
vis_ld64_2(dest, stride, DST_0);
vis_mul8x16(CONST_128, TMP8, TMP8);
vis_or(DST_2, REF_2, TMP12);
vis_ld64_2(dest, stride_8, DST_2);
vis_ld64(ref[0], TMP14);
vis_and(TMP6, MASK_7f, TMP6);
vis_and(TMP8, MASK_7f, TMP8);
vis_psub16(TMP10, TMP6, TMP6);
vis_st64(TMP6, dest[0]);
vis_psub16(TMP12, TMP8, TMP8);
vis_st64_2(TMP8, dest, 8);
dest += stride;
vis_faligndata(TMP0, TMP2, REF_0);
vis_faligndata(TMP2, TMP4, REF_2);
vis_xor(DST_0, REF_0, TMP20);
vis_and(TMP20, MASK_fe, TMP20);
vis_xor(DST_2, REF_2, TMP22);
vis_mul8x16(CONST_128, TMP20, TMP20);
vis_and(TMP22, MASK_fe, TMP22);
vis_or(DST_0, REF_0, TMP24);
vis_mul8x16(CONST_128, TMP22, TMP22);
vis_or(DST_2, REF_2, TMP26);
vis_and(TMP20, MASK_7f, TMP20);
vis_and(TMP22, MASK_7f, TMP22);
vis_psub16(TMP24, TMP20, TMP20);
vis_st64(TMP20, dest[0]);
vis_psub16(TMP26, TMP22, TMP22);
vis_st64_2(TMP22, dest, 8);
}
static void MC_avg_o_8_vis (uint8_t * dest, const ui
没有合适的资源?快使用搜索试试~ 我知道了~
解码hevc,解析h265流
共82个文件
h:27个
c:25个
cpp:18个
2星 需积分: 50 83 下载量 124 浏览量
2018-11-22
16:40:09
上传
评论 1
收藏 249KB RAR 举报
温馨提示
解码hevc,解析h265流 对于h265的监控和写文件解析,切分
资源推荐
资源详情
资源评论
收起资源包目录
NsIBPDecoder.rar (82个子文件)
NsIBPDecoder
NsIBPDecoder.rc 47B
CNs3DDecoderInstance.cpp 104KB
Parser
mpeg2dec.c 20KB
convert_internal.h 2KB
motion_comp_mmx.c 26KB
slice.cpp 87KB
motion_comp_altivec.c 30KB
video_out.c 2KB
motion_comp_alpha.c 8KB
gettimeofday.c 1KB
video_out_null.c 4KB
idct.cpp 8KB
idct_alpha.c 10KB
attributes.h 1KB
getopt.c 31KB
video_out_dx.c 16KB
dump_state.c 12KB
cpu_accel.obj 552B
vlc.h 17KB
rgb_mmx.obj 3KB
CNslibmpeg2.cpp 34KB
CNslibmpeg2.h 729B
decode.cpp 16KB
mpeg2_internal.h 10KB
alpha_asm.h 8KB
config.h 5KB
getopt.h 6KB
cpu_accel.c 5KB
idct_mmx.c 25KB
uyvy.c 4KB
rgb.c 20KB
rgb_mmx.c 10KB
tendra.h 1KB
motion_comp.cpp 4KB
idct_mmx.obj 8KB
video_out.h 2KB
extract_mpeg2.c 11KB
alloc.cpp 2KB
video_out_x11.c 17KB
motion_comp_vis.c 47KB
nsmpeg2.h 6KB
vssver2.scc 2KB
rgb_vis.c 9KB
motion_comp_mmx.obj 8KB
header.cpp 46KB
mpeg2.h 14KB
mpeg2convert.h 2KB
cpu_state.c 3KB
vis.h 12KB
idct_altivec.c 10KB
mmx.h 11KB
corrupt_mpeg2.c 9KB
video_out_sdl.c 5KB
video_out_pgm.c 11KB
cpu_state.obj 534B
nsH264SEI.h 2KB
NsMpegStreamUtils.cpp 27KB
nsH264Stream.cpp 79KB
CNs3DIBPDecoder.h 10KB
nsH264SEI.cpp 3KB
CustomBuild.bat 82B
CNs3DIBPDecoder.cpp 26KB
CNsDecoderInstance.h 9KB
CNsDecoder.cpp 55KB
CNsIBPDecoder.cpp 34KB
CNsDecoderManager.h 3KB
nsfileid.h 3KB
nsH264BitStream.cpp 2KB
NsIBPDecoder.def 170B
NsH264StreamUtils.cpp 37KB
CNsDecoderInstance.cpp 130KB
CNsIBPDecoder.h 8KB
CNsDecoder.h 7KB
CNsDecoderManager.cpp 32KB
vssver2.scc 1KB
NsMpegStreamUtils.h 2KB
NsH264StreamUtils.h 2KB
NsIBPDecoder.vcxproj.filters 5KB
NsIBPDecoder.vcxproj 31KB
nsH264BitStream.h 3KB
nsH264Stream.h 17KB
CNs3DDecoderInstance.h 7KB
共 82 条
- 1
资源评论
- xyq0044512020-04-27不能用,少NsdAPI.h,运行不了
- qq_337499632019-07-28还行 ,可以参考
- maybe5202021-01-15缺少NsdAPI.h,无法通过编译
徐秀丽
- 粉丝: 1
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- STM32单片机FPGA毕设电路原理论文报告一种基于st62单片机的称重显示控制器
- STM32单片机FPGA毕设电路原理论文报告一种基于SPCE061A单片机的信号发生器
- Ruby菜鸟入门指南.md
- STM32单片机FPGA毕设电路原理论文报告一种基于PIC系列单片机的SPWM逆变电源
- exp01A.cpp
- Rust语言学习万字指南!.md
- STM32单片机FPGA毕设电路原理论文报告一种基于msp430单片机的心电模块设计
- STM32单片机FPGA毕设电路原理论文报告一种基于MSP430单片机的日程管理系统
- web-screen-capture.jar
- 2024最新计算机二级真题练习题库含答案.md
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功