libvmx
VMX Codec
Loading...
Searching...
No Matches
vmxcodec_x86.h
Go to the documentation of this file.
1/*
2* MIT License
3*
4* Copyright (c) 2025 Open Media Transport Contributors
5*
6* Permission is hereby granted, free of charge, to any person obtaining a copy
7* of this software and associated documentation files (the "Software"), to deal
8* in the Software without restriction, including without limitation the rights
9* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10* copies of the Software, and to permit persons to whom the Software is
11* furnished to do so, subject to the following conditions:
12*
13* The above copyright notice and this permission notice shall be included in all
14* copies or substantial portions of the Software.
15*
16* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22* SOFTWARE.
23*
24*/
25#pragma once
26#include "vmxcodec.h"
27#if defined(X64)
28
29#include "vmxcodec_common.h"
30
31#if defined(__GNUC__)
32#define __lzcnt(t) __builtin_clz(t)
33#endif
34#if defined(__linux__) | defined(__APPLE__)
35#include <x86intrin.h>
36#define VMX_BUFFERSWAP(t) __builtin_bswap64(t)
37#else
38#include <intrin.h>
39#define VMX_BUFFERSWAP(t) _byteswap_uint64(t)
40#endif
41
42void VMX_BROADCAST_DC_8X8_128(short src, BYTE* dst, int stride, short addVal);
43void VMX_BROADCAST_DC_8X8_128_16(short src, BYTE* dst, int stride, short addVal);
44void VMX_ZIG_INVQUANTIZE_IDCT_8X8_128(short* src, unsigned short* matrix, BYTE* dst, int stride, short addVal);
45void VMX_ZIG_INVQUANTIZE_IDCT_8X8_128_16(short* src, unsigned short* matrix, BYTE* dst, int stride, short addVal);
46void VMX_FDCT_8X8_QUANT_ZIG_128(const BYTE* src, int stride, unsigned short* matrix, short addVal, __m128i* out0, __m128i* out1, __m128i* out2, __m128i* out3, __m128i* out4, __m128i* out5, __m128i* out6, __m128i* out7);
47void VMX_FDCT_8X8_QUANT_ZIG_128_16(const BYTE* src, int stride, unsigned short* matrix, short addVal, __m128i* out0, __m128i* out1, __m128i* out2, __m128i* out3, __m128i* out4, __m128i* out5, __m128i* out6, __m128i* out7);
48void VMX_PlanarToUYVY(BYTE* ysrc, int ystride, BYTE* usrc, int ustride, BYTE* vsrc, int vstride, BYTE* dst, int stride, VMX_SIZE size);
49void VMX_PlanarToP216(BYTE* ysrc, int ystride, BYTE* usrc, int ustride, BYTE* vsrc, int vstride, BYTE* dstY, int dstStrideY, BYTE* dstUV, int dstStrideUV, VMX_SIZE size);
50void VMX_UYVYToPlanar(BYTE* src, int stride, BYTE* ydst, int ystride, BYTE* udst, int ustride, BYTE* vdst, int vstride, VMX_SIZE size);
51void VMX_P216ToPlanar(BYTE* srcY, int srcStrideY, BYTE* srcUV, int srcStrideUV, BYTE* ydst, int ystride, BYTE* udst, int ustride, BYTE* vdst, int vstride, VMX_SIZE size);
52void VMX_AToPlanar(BYTE* src, int srcStride, BYTE* adst, int astride, VMX_SIZE size);
53void VMX_A16ToPlanar(BYTE* src, int srcStride, BYTE* adst, int astride, VMX_SIZE size);
54void VMX_PlanarToA(BYTE* asrc, int astride, BYTE* dst, int dstStride, VMX_SIZE size);
55void VMX_PlanarToA16(BYTE* asrc, int astride, BYTE* dst, int dstStride, VMX_SIZE size);
56void VMX_PlanarToYUY2(BYTE* ysrc, int ystride, BYTE* usrc, int ustride, BYTE* vsrc, int vstride, BYTE* dst, int stride, VMX_SIZE size);
57void VMX_YUY2ToPlanar(BYTE* src, int stride, BYTE* ydst, int ystride, BYTE* udst, int ustride, BYTE* vdst, int vstride, VMX_SIZE size);
58void VMX_NV12ToPlanar(BYTE* srcY, int strideY, BYTE * srcUV, int strideUV, BYTE* ydst, int ystride, BYTE* udst, int ustride, BYTE* vdst, int vstride, VMX_SIZE size);
59void VMX_YV12ToPlanar(BYTE* srcY, int srcStrideY, BYTE* srcU, int srcStrideU, BYTE* srcV, int srcStrideV, BYTE* ydst, int ystride, BYTE* udst, int ustride, BYTE* vdst, int vstride, VMX_SIZE size);
60void VMX_EncodePlaneInternal(VMX_INSTANCE* instance, VMX_PLANE * pPlane, VMX_SLICE_SET* s);
61void VMX_EncodePlaneInternal16(VMX_INSTANCE* instance, VMX_PLANE* pPlane, VMX_SLICE_SET* s);
62void VMX_YUV4224ToBGRA(BYTE* pSrcY, int iStrideY, BYTE* pSrcU, int iStrideU, BYTE* pSrcV, int iStrideV, BYTE* pSrcA, int iStrideA, BYTE* pDst, int dstStride, VMX_SIZE sz, const short * colorTable);
63void VMX_BGRAToYUV4224(BYTE* pSrc, int srcStride, BYTE* pDstY, int iStrideY, BYTE* pDstU, int iStrideU, BYTE* pDstV, int iStrideV, BYTE* pDstA, int iStrideA, VMX_SIZE sz, const ShortRGB * colorTables);
64void VMX_DecodePlaneInternal(VMX_INSTANCE* instance, VMX_PLANE* pPlane, VMX_SLICE_SET* s);
65void VMX_DecodePlaneInternal16(VMX_INSTANCE* instance, VMX_PLANE* pPlane, VMX_SLICE_SET* s);
66void VMX_DecodePlanePreviewInternal(VMX_INSTANCE* instance, VMX_PLANE* pPlane, VMX_SLICE_SET* s);
67void VMX_BGRXToUYVYInternal(BYTE* pSrc, int srcStride, BYTE* pDst, int iStride, VMX_SIZE sz, const ShortRGB* colorTables);
68int VMX_BGRXToUYVYConditionalInternal(BYTE* pSrc, BYTE* pSrcPrev, int srcStride, BYTE* pDst, int iStride, VMX_SIZE sz, const ShortRGB* colorTables);
69float VMX_CalculatePSNR_128(BYTE* p1, BYTE* p2, int stride, int bytesPerPixel, VMX_SIZE sz);
70
71#endif
int64x2_t __m128i
Definition sse2neon.h:415
Definition vmxcodec_common.h:143
Definition vmxcodec.h:147
Definition vmxcodec.h:138
Definition vmxcodec.h:50
Definition vmxcodec.h:124
unsigned char BYTE
Definition vmxcodec.h:48