forked from mirror/libbpg
libbpg-0.9.5
This commit is contained in:
parent
6e56352f86
commit
357f186837
35 changed files with 3022 additions and 2134 deletions
|
@ -1,592 +0,0 @@
|
|||
/*
|
||||
* Provide registration of all codecs, parsers and bitstream filters for libavcodec.
|
||||
* Copyright (c) 2002 Fabrice Bellard
|
||||
*
|
||||
* 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
|
||||
* Provide registration of all codecs, parsers and bitstream filters for libavcodec.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "avcodec.h"
|
||||
#include "version.h"
|
||||
|
||||
#define REGISTER_HWACCEL(X, x) \
|
||||
{ \
|
||||
extern AVHWAccel ff_##x##_hwaccel; \
|
||||
if (CONFIG_##X##_HWACCEL) \
|
||||
av_register_hwaccel(&ff_##x##_hwaccel); \
|
||||
}
|
||||
|
||||
#define REGISTER_ENCODER(X, x) \
|
||||
{ \
|
||||
extern AVCodec ff_##x##_encoder; \
|
||||
if (CONFIG_##X##_ENCODER) \
|
||||
avcodec_register(&ff_##x##_encoder); \
|
||||
}
|
||||
|
||||
#define REGISTER_DECODER(X, x) \
|
||||
{ \
|
||||
extern AVCodec ff_##x##_decoder; \
|
||||
if (CONFIG_##X##_DECODER) \
|
||||
avcodec_register(&ff_##x##_decoder); \
|
||||
}
|
||||
|
||||
#define REGISTER_ENCDEC(X, x) REGISTER_ENCODER(X, x); REGISTER_DECODER(X, x)
|
||||
|
||||
#define REGISTER_PARSER(X, x) \
|
||||
{ \
|
||||
extern AVCodecParser ff_##x##_parser; \
|
||||
if (CONFIG_##X##_PARSER) \
|
||||
av_register_codec_parser(&ff_##x##_parser); \
|
||||
}
|
||||
|
||||
#define REGISTER_BSF(X, x) \
|
||||
{ \
|
||||
extern AVBitStreamFilter ff_##x##_bsf; \
|
||||
if (CONFIG_##X##_BSF) \
|
||||
av_register_bitstream_filter(&ff_##x##_bsf); \
|
||||
}
|
||||
|
||||
void avcodec_register_all(void)
|
||||
{
|
||||
static int initialized;
|
||||
|
||||
if (initialized)
|
||||
return;
|
||||
initialized = 1;
|
||||
|
||||
/* hardware accelerators */
|
||||
REGISTER_HWACCEL(H263_VAAPI, h263_vaapi);
|
||||
REGISTER_HWACCEL(H263_VDPAU, h263_vdpau);
|
||||
REGISTER_HWACCEL(H264_DXVA2, h264_dxva2);
|
||||
REGISTER_HWACCEL(H264_VAAPI, h264_vaapi);
|
||||
REGISTER_HWACCEL(H264_VDA, h264_vda);
|
||||
REGISTER_HWACCEL(H264_VDA_OLD, h264_vda_old);
|
||||
REGISTER_HWACCEL(H264_VDPAU, h264_vdpau);
|
||||
REGISTER_HWACCEL(MPEG1_XVMC, mpeg1_xvmc);
|
||||
REGISTER_HWACCEL(MPEG1_VDPAU, mpeg1_vdpau);
|
||||
REGISTER_HWACCEL(MPEG2_XVMC, mpeg2_xvmc);
|
||||
REGISTER_HWACCEL(MPEG2_DXVA2, mpeg2_dxva2);
|
||||
REGISTER_HWACCEL(MPEG2_VAAPI, mpeg2_vaapi);
|
||||
REGISTER_HWACCEL(MPEG2_VDPAU, mpeg2_vdpau);
|
||||
REGISTER_HWACCEL(MPEG4_VAAPI, mpeg4_vaapi);
|
||||
REGISTER_HWACCEL(MPEG4_VDPAU, mpeg4_vdpau);
|
||||
REGISTER_HWACCEL(VC1_DXVA2, vc1_dxva2);
|
||||
REGISTER_HWACCEL(VC1_VAAPI, vc1_vaapi);
|
||||
REGISTER_HWACCEL(VC1_VDPAU, vc1_vdpau);
|
||||
REGISTER_HWACCEL(WMV3_DXVA2, wmv3_dxva2);
|
||||
REGISTER_HWACCEL(WMV3_VAAPI, wmv3_vaapi);
|
||||
REGISTER_HWACCEL(WMV3_VDPAU, wmv3_vdpau);
|
||||
|
||||
/* video codecs */
|
||||
REGISTER_ENCODER(A64MULTI, a64multi);
|
||||
REGISTER_ENCODER(A64MULTI5, a64multi5);
|
||||
REGISTER_DECODER(AASC, aasc);
|
||||
REGISTER_DECODER(AIC, aic);
|
||||
REGISTER_ENCDEC (ALIAS_PIX, alias_pix);
|
||||
REGISTER_ENCDEC (AMV, amv);
|
||||
REGISTER_DECODER(ANM, anm);
|
||||
REGISTER_DECODER(ANSI, ansi);
|
||||
REGISTER_ENCDEC (ASV1, asv1);
|
||||
REGISTER_ENCDEC (ASV2, asv2);
|
||||
REGISTER_DECODER(AURA, aura);
|
||||
REGISTER_DECODER(AURA2, aura2);
|
||||
REGISTER_ENCDEC (AVRP, avrp);
|
||||
REGISTER_DECODER(AVRN, avrn);
|
||||
REGISTER_DECODER(AVS, avs);
|
||||
REGISTER_ENCDEC (AVUI, avui);
|
||||
REGISTER_ENCDEC (AYUV, ayuv);
|
||||
REGISTER_DECODER(BETHSOFTVID, bethsoftvid);
|
||||
REGISTER_DECODER(BFI, bfi);
|
||||
REGISTER_DECODER(BINK, bink);
|
||||
REGISTER_ENCDEC (BMP, bmp);
|
||||
REGISTER_DECODER(BMV_VIDEO, bmv_video);
|
||||
REGISTER_DECODER(BRENDER_PIX, brender_pix);
|
||||
REGISTER_DECODER(C93, c93);
|
||||
REGISTER_DECODER(CAVS, cavs);
|
||||
REGISTER_DECODER(CDGRAPHICS, cdgraphics);
|
||||
REGISTER_DECODER(CDXL, cdxl);
|
||||
REGISTER_ENCDEC (CINEPAK, cinepak);
|
||||
REGISTER_ENCDEC (CLJR, cljr);
|
||||
REGISTER_DECODER(CLLC, cllc);
|
||||
REGISTER_ENCDEC (COMFORTNOISE, comfortnoise);
|
||||
REGISTER_DECODER(CPIA, cpia);
|
||||
REGISTER_DECODER(CSCD, cscd);
|
||||
REGISTER_DECODER(CYUV, cyuv);
|
||||
REGISTER_DECODER(DFA, dfa);
|
||||
REGISTER_DECODER(DIRAC, dirac);
|
||||
REGISTER_ENCDEC (DNXHD, dnxhd);
|
||||
REGISTER_ENCDEC (DPX, dpx);
|
||||
REGISTER_DECODER(DSICINVIDEO, dsicinvideo);
|
||||
REGISTER_ENCDEC (DVVIDEO, dvvideo);
|
||||
REGISTER_DECODER(DXA, dxa);
|
||||
REGISTER_DECODER(DXTORY, dxtory);
|
||||
REGISTER_DECODER(EACMV, eacmv);
|
||||
REGISTER_DECODER(EAMAD, eamad);
|
||||
REGISTER_DECODER(EATGQ, eatgq);
|
||||
REGISTER_DECODER(EATGV, eatgv);
|
||||
REGISTER_DECODER(EATQI, eatqi);
|
||||
REGISTER_DECODER(EIGHTBPS, eightbps);
|
||||
REGISTER_DECODER(EIGHTSVX_EXP, eightsvx_exp);
|
||||
REGISTER_DECODER(EIGHTSVX_FIB, eightsvx_fib);
|
||||
REGISTER_DECODER(ESCAPE124, escape124);
|
||||
REGISTER_DECODER(ESCAPE130, escape130);
|
||||
REGISTER_DECODER(EXR, exr);
|
||||
REGISTER_ENCDEC (FFV1, ffv1);
|
||||
REGISTER_ENCDEC (FFVHUFF, ffvhuff);
|
||||
REGISTER_DECODER(FIC, fic);
|
||||
REGISTER_ENCDEC (FLASHSV, flashsv);
|
||||
REGISTER_ENCDEC (FLASHSV2, flashsv2);
|
||||
REGISTER_DECODER(FLIC, flic);
|
||||
REGISTER_ENCDEC (FLV, flv);
|
||||
REGISTER_DECODER(FOURXM, fourxm);
|
||||
REGISTER_DECODER(FRAPS, fraps);
|
||||
REGISTER_DECODER(FRWU, frwu);
|
||||
REGISTER_DECODER(G2M, g2m);
|
||||
REGISTER_ENCDEC (GIF, gif);
|
||||
REGISTER_ENCDEC (H261, h261);
|
||||
REGISTER_ENCDEC (H263, h263);
|
||||
REGISTER_DECODER(H263I, h263i);
|
||||
REGISTER_ENCDEC (H263P, h263p);
|
||||
REGISTER_DECODER(H264, h264);
|
||||
REGISTER_DECODER(H264_CRYSTALHD, h264_crystalhd);
|
||||
REGISTER_DECODER(H264_VDA, h264_vda);
|
||||
REGISTER_DECODER(H264_VDPAU, h264_vdpau);
|
||||
REGISTER_DECODER(HEVC, hevc);
|
||||
REGISTER_DECODER(HNM4_VIDEO, hnm4_video);
|
||||
REGISTER_ENCDEC (HUFFYUV, huffyuv);
|
||||
REGISTER_DECODER(IDCIN, idcin);
|
||||
REGISTER_DECODER(IFF_BYTERUN1, iff_byterun1);
|
||||
REGISTER_DECODER(IFF_ILBM, iff_ilbm);
|
||||
REGISTER_DECODER(INDEO2, indeo2);
|
||||
REGISTER_DECODER(INDEO3, indeo3);
|
||||
REGISTER_DECODER(INDEO4, indeo4);
|
||||
REGISTER_DECODER(INDEO5, indeo5);
|
||||
REGISTER_DECODER(INTERPLAY_VIDEO, interplay_video);
|
||||
REGISTER_ENCDEC (JPEG2000, jpeg2000);
|
||||
REGISTER_ENCDEC (JPEGLS, jpegls);
|
||||
REGISTER_DECODER(JV, jv);
|
||||
REGISTER_DECODER(KGV1, kgv1);
|
||||
REGISTER_DECODER(KMVC, kmvc);
|
||||
REGISTER_DECODER(LAGARITH, lagarith);
|
||||
REGISTER_ENCODER(LJPEG, ljpeg);
|
||||
REGISTER_DECODER(LOCO, loco);
|
||||
REGISTER_DECODER(MDEC, mdec);
|
||||
REGISTER_DECODER(MIMIC, mimic);
|
||||
REGISTER_ENCDEC (MJPEG, mjpeg);
|
||||
REGISTER_DECODER(MJPEGB, mjpegb);
|
||||
REGISTER_DECODER(MMVIDEO, mmvideo);
|
||||
REGISTER_DECODER(MOTIONPIXELS, motionpixels);
|
||||
#if FF_API_XVMC
|
||||
REGISTER_DECODER(MPEG_XVMC, mpeg_xvmc);
|
||||
#endif /* FF_API_XVMC */
|
||||
REGISTER_ENCDEC (MPEG1VIDEO, mpeg1video);
|
||||
REGISTER_ENCDEC (MPEG2VIDEO, mpeg2video);
|
||||
REGISTER_ENCDEC (MPEG4, mpeg4);
|
||||
REGISTER_DECODER(MPEG4_CRYSTALHD, mpeg4_crystalhd);
|
||||
REGISTER_DECODER(MPEG4_VDPAU, mpeg4_vdpau);
|
||||
REGISTER_DECODER(MPEGVIDEO, mpegvideo);
|
||||
REGISTER_DECODER(MPEG_VDPAU, mpeg_vdpau);
|
||||
REGISTER_DECODER(MPEG1_VDPAU, mpeg1_vdpau);
|
||||
REGISTER_DECODER(MPEG2_CRYSTALHD, mpeg2_crystalhd);
|
||||
REGISTER_DECODER(MSA1, msa1);
|
||||
REGISTER_DECODER(MSMPEG4_CRYSTALHD, msmpeg4_crystalhd);
|
||||
REGISTER_DECODER(MSMPEG4V1, msmpeg4v1);
|
||||
REGISTER_ENCDEC (MSMPEG4V2, msmpeg4v2);
|
||||
REGISTER_ENCDEC (MSMPEG4V3, msmpeg4v3);
|
||||
REGISTER_DECODER(MSRLE, msrle);
|
||||
REGISTER_DECODER(MSS1, mss1);
|
||||
REGISTER_DECODER(MSS2, mss2);
|
||||
REGISTER_ENCDEC (MSVIDEO1, msvideo1);
|
||||
REGISTER_DECODER(MSZH, mszh);
|
||||
REGISTER_DECODER(MTS2, mts2);
|
||||
REGISTER_DECODER(MVC1, mvc1);
|
||||
REGISTER_DECODER(MVC2, mvc2);
|
||||
REGISTER_DECODER(MXPEG, mxpeg);
|
||||
REGISTER_DECODER(NUV, nuv);
|
||||
REGISTER_DECODER(PAF_VIDEO, paf_video);
|
||||
REGISTER_ENCDEC (PAM, pam);
|
||||
REGISTER_ENCDEC (PBM, pbm);
|
||||
REGISTER_ENCDEC (PCX, pcx);
|
||||
REGISTER_ENCDEC (PGM, pgm);
|
||||
REGISTER_ENCDEC (PGMYUV, pgmyuv);
|
||||
REGISTER_DECODER(PICTOR, pictor);
|
||||
REGISTER_ENCDEC (PNG, png);
|
||||
REGISTER_ENCDEC (PPM, ppm);
|
||||
REGISTER_ENCDEC (PRORES, prores);
|
||||
REGISTER_ENCODER(PRORES_AW, prores_aw);
|
||||
REGISTER_ENCODER(PRORES_KS, prores_ks);
|
||||
REGISTER_DECODER(PRORES_LGPL, prores_lgpl);
|
||||
REGISTER_DECODER(PTX, ptx);
|
||||
REGISTER_DECODER(QDRAW, qdraw);
|
||||
REGISTER_DECODER(QPEG, qpeg);
|
||||
REGISTER_ENCDEC (QTRLE, qtrle);
|
||||
REGISTER_ENCDEC (R10K, r10k);
|
||||
REGISTER_ENCDEC (R210, r210);
|
||||
REGISTER_ENCDEC (RAWVIDEO, rawvideo);
|
||||
REGISTER_DECODER(RL2, rl2);
|
||||
REGISTER_ENCDEC (ROQ, roq);
|
||||
REGISTER_DECODER(RPZA, rpza);
|
||||
REGISTER_ENCDEC (RV10, rv10);
|
||||
REGISTER_ENCDEC (RV20, rv20);
|
||||
REGISTER_DECODER(RV30, rv30);
|
||||
REGISTER_DECODER(RV40, rv40);
|
||||
REGISTER_ENCDEC (S302M, s302m);
|
||||
REGISTER_DECODER(SANM, sanm);
|
||||
REGISTER_ENCDEC (SGI, sgi);
|
||||
REGISTER_DECODER(SGIRLE, sgirle);
|
||||
REGISTER_DECODER(SMACKER, smacker);
|
||||
REGISTER_DECODER(SMC, smc);
|
||||
REGISTER_DECODER(SMVJPEG, smvjpeg);
|
||||
REGISTER_ENCDEC (SNOW, snow);
|
||||
REGISTER_DECODER(SP5X, sp5x);
|
||||
REGISTER_ENCDEC (SUNRAST, sunrast);
|
||||
REGISTER_ENCDEC (SVQ1, svq1);
|
||||
REGISTER_DECODER(SVQ3, svq3);
|
||||
REGISTER_ENCDEC (TARGA, targa);
|
||||
REGISTER_DECODER(TARGA_Y216, targa_y216);
|
||||
REGISTER_DECODER(THEORA, theora);
|
||||
REGISTER_DECODER(THP, thp);
|
||||
REGISTER_DECODER(TIERTEXSEQVIDEO, tiertexseqvideo);
|
||||
REGISTER_ENCDEC (TIFF, tiff);
|
||||
REGISTER_DECODER(TMV, tmv);
|
||||
REGISTER_DECODER(TRUEMOTION1, truemotion1);
|
||||
REGISTER_DECODER(TRUEMOTION2, truemotion2);
|
||||
REGISTER_DECODER(TSCC, tscc);
|
||||
REGISTER_DECODER(TSCC2, tscc2);
|
||||
REGISTER_DECODER(TXD, txd);
|
||||
REGISTER_DECODER(ULTI, ulti);
|
||||
REGISTER_ENCDEC (UTVIDEO, utvideo);
|
||||
REGISTER_ENCDEC (V210, v210);
|
||||
REGISTER_DECODER(V210X, v210x);
|
||||
REGISTER_ENCDEC (V308, v308);
|
||||
REGISTER_ENCDEC (V408, v408);
|
||||
REGISTER_ENCDEC (V410, v410);
|
||||
REGISTER_DECODER(VB, vb);
|
||||
REGISTER_DECODER(VBLE, vble);
|
||||
REGISTER_DECODER(VC1, vc1);
|
||||
REGISTER_DECODER(VC1_CRYSTALHD, vc1_crystalhd);
|
||||
REGISTER_DECODER(VC1_VDPAU, vc1_vdpau);
|
||||
REGISTER_DECODER(VC1IMAGE, vc1image);
|
||||
REGISTER_DECODER(VCR1, vcr1);
|
||||
REGISTER_DECODER(VMDVIDEO, vmdvideo);
|
||||
REGISTER_DECODER(VMNC, vmnc);
|
||||
REGISTER_DECODER(VP3, vp3);
|
||||
REGISTER_DECODER(VP5, vp5);
|
||||
REGISTER_DECODER(VP6, vp6);
|
||||
REGISTER_DECODER(VP6A, vp6a);
|
||||
REGISTER_DECODER(VP6F, vp6f);
|
||||
REGISTER_DECODER(VP7, vp7);
|
||||
REGISTER_DECODER(VP8, vp8);
|
||||
REGISTER_DECODER(VP9, vp9);
|
||||
REGISTER_DECODER(VQA, vqa);
|
||||
REGISTER_DECODER(WEBP, webp);
|
||||
REGISTER_ENCDEC (WMV1, wmv1);
|
||||
REGISTER_ENCDEC (WMV2, wmv2);
|
||||
REGISTER_DECODER(WMV3, wmv3);
|
||||
REGISTER_DECODER(WMV3_CRYSTALHD, wmv3_crystalhd);
|
||||
REGISTER_DECODER(WMV3_VDPAU, wmv3_vdpau);
|
||||
REGISTER_DECODER(WMV3IMAGE, wmv3image);
|
||||
REGISTER_DECODER(WNV1, wnv1);
|
||||
REGISTER_DECODER(XAN_WC3, xan_wc3);
|
||||
REGISTER_DECODER(XAN_WC4, xan_wc4);
|
||||
REGISTER_ENCDEC (XBM, xbm);
|
||||
REGISTER_ENCDEC (XFACE, xface);
|
||||
REGISTER_DECODER(XL, xl);
|
||||
REGISTER_ENCDEC (XWD, xwd);
|
||||
REGISTER_ENCDEC (Y41P, y41p);
|
||||
REGISTER_DECODER(YOP, yop);
|
||||
REGISTER_ENCDEC (YUV4, yuv4);
|
||||
REGISTER_DECODER(ZERO12V, zero12v);
|
||||
REGISTER_DECODER(ZEROCODEC, zerocodec);
|
||||
REGISTER_ENCDEC (ZLIB, zlib);
|
||||
REGISTER_ENCDEC (ZMBV, zmbv);
|
||||
|
||||
/* audio codecs */
|
||||
REGISTER_ENCDEC (AAC, aac);
|
||||
REGISTER_DECODER(AAC_LATM, aac_latm);
|
||||
REGISTER_ENCDEC (AC3, ac3);
|
||||
REGISTER_ENCDEC (AC3_FIXED, ac3_fixed);
|
||||
REGISTER_ENCDEC (ALAC, alac);
|
||||
REGISTER_DECODER(ALS, als);
|
||||
REGISTER_DECODER(AMRNB, amrnb);
|
||||
REGISTER_DECODER(AMRWB, amrwb);
|
||||
REGISTER_DECODER(APE, ape);
|
||||
REGISTER_DECODER(ATRAC1, atrac1);
|
||||
REGISTER_DECODER(ATRAC3, atrac3);
|
||||
REGISTER_DECODER(ATRAC3P, atrac3p);
|
||||
REGISTER_DECODER(BINKAUDIO_DCT, binkaudio_dct);
|
||||
REGISTER_DECODER(BINKAUDIO_RDFT, binkaudio_rdft);
|
||||
REGISTER_DECODER(BMV_AUDIO, bmv_audio);
|
||||
REGISTER_DECODER(COOK, cook);
|
||||
REGISTER_ENCDEC (DCA, dca);
|
||||
REGISTER_DECODER(DSD_LSBF, dsd_lsbf);
|
||||
REGISTER_DECODER(DSD_MSBF, dsd_msbf);
|
||||
REGISTER_DECODER(DSD_LSBF_PLANAR, dsd_lsbf_planar);
|
||||
REGISTER_DECODER(DSD_MSBF_PLANAR, dsd_msbf_planar);
|
||||
REGISTER_DECODER(DSICINAUDIO, dsicinaudio);
|
||||
REGISTER_ENCDEC (EAC3, eac3);
|
||||
REGISTER_DECODER(EVRC, evrc);
|
||||
REGISTER_DECODER(FFWAVESYNTH, ffwavesynth);
|
||||
REGISTER_ENCDEC (FLAC, flac);
|
||||
REGISTER_ENCDEC (G723_1, g723_1);
|
||||
REGISTER_DECODER(G729, g729);
|
||||
REGISTER_DECODER(GSM, gsm);
|
||||
REGISTER_DECODER(GSM_MS, gsm_ms);
|
||||
REGISTER_DECODER(IAC, iac);
|
||||
REGISTER_DECODER(IMC, imc);
|
||||
REGISTER_DECODER(MACE3, mace3);
|
||||
REGISTER_DECODER(MACE6, mace6);
|
||||
REGISTER_DECODER(METASOUND, metasound);
|
||||
REGISTER_DECODER(MLP, mlp);
|
||||
REGISTER_DECODER(MP1, mp1);
|
||||
REGISTER_DECODER(MP1FLOAT, mp1float);
|
||||
REGISTER_ENCDEC (MP2, mp2);
|
||||
REGISTER_DECODER(MP2FLOAT, mp2float);
|
||||
REGISTER_ENCODER(MP2FIXED, mp2fixed);
|
||||
REGISTER_DECODER(MP3, mp3);
|
||||
REGISTER_DECODER(MP3FLOAT, mp3float);
|
||||
REGISTER_DECODER(MP3ADU, mp3adu);
|
||||
REGISTER_DECODER(MP3ADUFLOAT, mp3adufloat);
|
||||
REGISTER_DECODER(MP3ON4, mp3on4);
|
||||
REGISTER_DECODER(MP3ON4FLOAT, mp3on4float);
|
||||
REGISTER_DECODER(MPC7, mpc7);
|
||||
REGISTER_DECODER(MPC8, mpc8);
|
||||
REGISTER_ENCDEC (NELLYMOSER, nellymoser);
|
||||
REGISTER_DECODER(ON2AVC, on2avc);
|
||||
REGISTER_DECODER(OPUS, opus);
|
||||
REGISTER_DECODER(PAF_AUDIO, paf_audio);
|
||||
REGISTER_DECODER(QCELP, qcelp);
|
||||
REGISTER_DECODER(QDM2, qdm2);
|
||||
REGISTER_ENCDEC (RA_144, ra_144);
|
||||
REGISTER_DECODER(RA_288, ra_288);
|
||||
REGISTER_DECODER(RALF, ralf);
|
||||
REGISTER_DECODER(SHORTEN, shorten);
|
||||
REGISTER_DECODER(SIPR, sipr);
|
||||
REGISTER_DECODER(SMACKAUD, smackaud);
|
||||
REGISTER_ENCDEC (SONIC, sonic);
|
||||
REGISTER_ENCODER(SONIC_LS, sonic_ls);
|
||||
REGISTER_DECODER(TAK, tak);
|
||||
REGISTER_DECODER(TRUEHD, truehd);
|
||||
REGISTER_DECODER(TRUESPEECH, truespeech);
|
||||
REGISTER_ENCDEC (TTA, tta);
|
||||
REGISTER_DECODER(TWINVQ, twinvq);
|
||||
REGISTER_DECODER(VMDAUDIO, vmdaudio);
|
||||
REGISTER_ENCDEC (VORBIS, vorbis);
|
||||
REGISTER_ENCDEC (WAVPACK, wavpack);
|
||||
REGISTER_DECODER(WMALOSSLESS, wmalossless);
|
||||
REGISTER_DECODER(WMAPRO, wmapro);
|
||||
REGISTER_ENCDEC (WMAV1, wmav1);
|
||||
REGISTER_ENCDEC (WMAV2, wmav2);
|
||||
REGISTER_DECODER(WMAVOICE, wmavoice);
|
||||
REGISTER_DECODER(WS_SND1, ws_snd1);
|
||||
|
||||
/* PCM codecs */
|
||||
REGISTER_ENCDEC (PCM_ALAW, pcm_alaw);
|
||||
REGISTER_DECODER(PCM_BLURAY, pcm_bluray);
|
||||
REGISTER_DECODER(PCM_DVD, pcm_dvd);
|
||||
REGISTER_ENCDEC (PCM_F32BE, pcm_f32be);
|
||||
REGISTER_ENCDEC (PCM_F32LE, pcm_f32le);
|
||||
REGISTER_ENCDEC (PCM_F64BE, pcm_f64be);
|
||||
REGISTER_ENCDEC (PCM_F64LE, pcm_f64le);
|
||||
REGISTER_DECODER(PCM_LXF, pcm_lxf);
|
||||
REGISTER_ENCDEC (PCM_MULAW, pcm_mulaw);
|
||||
REGISTER_ENCDEC (PCM_S8, pcm_s8);
|
||||
REGISTER_ENCDEC (PCM_S8_PLANAR, pcm_s8_planar);
|
||||
REGISTER_ENCDEC (PCM_S16BE, pcm_s16be);
|
||||
REGISTER_ENCDEC (PCM_S16BE_PLANAR, pcm_s16be_planar);
|
||||
REGISTER_ENCDEC (PCM_S16LE, pcm_s16le);
|
||||
REGISTER_ENCDEC (PCM_S16LE_PLANAR, pcm_s16le_planar);
|
||||
REGISTER_ENCDEC (PCM_S24BE, pcm_s24be);
|
||||
REGISTER_ENCDEC (PCM_S24DAUD, pcm_s24daud);
|
||||
REGISTER_ENCDEC (PCM_S24LE, pcm_s24le);
|
||||
REGISTER_ENCDEC (PCM_S24LE_PLANAR, pcm_s24le_planar);
|
||||
REGISTER_ENCDEC (PCM_S32BE, pcm_s32be);
|
||||
REGISTER_ENCDEC (PCM_S32LE, pcm_s32le);
|
||||
REGISTER_ENCDEC (PCM_S32LE_PLANAR, pcm_s32le_planar);
|
||||
REGISTER_ENCDEC (PCM_U8, pcm_u8);
|
||||
REGISTER_ENCDEC (PCM_U16BE, pcm_u16be);
|
||||
REGISTER_ENCDEC (PCM_U16LE, pcm_u16le);
|
||||
REGISTER_ENCDEC (PCM_U24BE, pcm_u24be);
|
||||
REGISTER_ENCDEC (PCM_U24LE, pcm_u24le);
|
||||
REGISTER_ENCDEC (PCM_U32BE, pcm_u32be);
|
||||
REGISTER_ENCDEC (PCM_U32LE, pcm_u32le);
|
||||
REGISTER_DECODER(PCM_ZORK, pcm_zork);
|
||||
|
||||
/* DPCM codecs */
|
||||
REGISTER_DECODER(INTERPLAY_DPCM, interplay_dpcm);
|
||||
REGISTER_ENCDEC (ROQ_DPCM, roq_dpcm);
|
||||
REGISTER_DECODER(SOL_DPCM, sol_dpcm);
|
||||
REGISTER_DECODER(XAN_DPCM, xan_dpcm);
|
||||
|
||||
/* ADPCM codecs */
|
||||
REGISTER_DECODER(ADPCM_4XM, adpcm_4xm);
|
||||
REGISTER_ENCDEC (ADPCM_ADX, adpcm_adx);
|
||||
REGISTER_DECODER(ADPCM_AFC, adpcm_afc);
|
||||
REGISTER_DECODER(ADPCM_CT, adpcm_ct);
|
||||
REGISTER_DECODER(ADPCM_DTK, adpcm_dtk);
|
||||
REGISTER_DECODER(ADPCM_EA, adpcm_ea);
|
||||
REGISTER_DECODER(ADPCM_EA_MAXIS_XA, adpcm_ea_maxis_xa);
|
||||
REGISTER_DECODER(ADPCM_EA_R1, adpcm_ea_r1);
|
||||
REGISTER_DECODER(ADPCM_EA_R2, adpcm_ea_r2);
|
||||
REGISTER_DECODER(ADPCM_EA_R3, adpcm_ea_r3);
|
||||
REGISTER_DECODER(ADPCM_EA_XAS, adpcm_ea_xas);
|
||||
REGISTER_ENCDEC (ADPCM_G722, adpcm_g722);
|
||||
REGISTER_ENCDEC (ADPCM_G726, adpcm_g726);
|
||||
REGISTER_DECODER(ADPCM_G726LE, adpcm_g726le);
|
||||
REGISTER_DECODER(ADPCM_IMA_AMV, adpcm_ima_amv);
|
||||
REGISTER_DECODER(ADPCM_IMA_APC, adpcm_ima_apc);
|
||||
REGISTER_DECODER(ADPCM_IMA_DK3, adpcm_ima_dk3);
|
||||
REGISTER_DECODER(ADPCM_IMA_DK4, adpcm_ima_dk4);
|
||||
REGISTER_DECODER(ADPCM_IMA_EA_EACS, adpcm_ima_ea_eacs);
|
||||
REGISTER_DECODER(ADPCM_IMA_EA_SEAD, adpcm_ima_ea_sead);
|
||||
REGISTER_DECODER(ADPCM_IMA_ISS, adpcm_ima_iss);
|
||||
REGISTER_DECODER(ADPCM_IMA_OKI, adpcm_ima_oki);
|
||||
REGISTER_ENCDEC (ADPCM_IMA_QT, adpcm_ima_qt);
|
||||
REGISTER_DECODER(ADPCM_IMA_RAD, adpcm_ima_rad);
|
||||
REGISTER_DECODER(ADPCM_IMA_SMJPEG, adpcm_ima_smjpeg);
|
||||
REGISTER_ENCDEC (ADPCM_IMA_WAV, adpcm_ima_wav);
|
||||
REGISTER_DECODER(ADPCM_IMA_WS, adpcm_ima_ws);
|
||||
REGISTER_ENCDEC (ADPCM_MS, adpcm_ms);
|
||||
REGISTER_DECODER(ADPCM_SBPRO_2, adpcm_sbpro_2);
|
||||
REGISTER_DECODER(ADPCM_SBPRO_3, adpcm_sbpro_3);
|
||||
REGISTER_DECODER(ADPCM_SBPRO_4, adpcm_sbpro_4);
|
||||
REGISTER_ENCDEC (ADPCM_SWF, adpcm_swf);
|
||||
REGISTER_DECODER(ADPCM_THP, adpcm_thp);
|
||||
REGISTER_DECODER(ADPCM_VIMA, adpcm_vima);
|
||||
REGISTER_DECODER(ADPCM_XA, adpcm_xa);
|
||||
REGISTER_ENCDEC (ADPCM_YAMAHA, adpcm_yamaha);
|
||||
REGISTER_DECODER(VIMA, vima);
|
||||
|
||||
/* subtitles */
|
||||
REGISTER_ENCDEC (SSA, ssa);
|
||||
REGISTER_ENCDEC (ASS, ass);
|
||||
REGISTER_ENCDEC (DVBSUB, dvbsub);
|
||||
REGISTER_ENCDEC (DVDSUB, dvdsub);
|
||||
REGISTER_DECODER(JACOSUB, jacosub);
|
||||
REGISTER_DECODER(MICRODVD, microdvd);
|
||||
REGISTER_ENCDEC (MOVTEXT, movtext);
|
||||
REGISTER_DECODER(MPL2, mpl2);
|
||||
REGISTER_DECODER(PGSSUB, pgssub);
|
||||
REGISTER_DECODER(PJS, pjs);
|
||||
REGISTER_DECODER(REALTEXT, realtext);
|
||||
REGISTER_DECODER(SAMI, sami);
|
||||
REGISTER_ENCDEC (SRT, srt);
|
||||
REGISTER_DECODER(STL, stl);
|
||||
REGISTER_ENCDEC (SUBRIP, subrip);
|
||||
REGISTER_DECODER(SUBVIEWER, subviewer);
|
||||
REGISTER_DECODER(SUBVIEWER1, subviewer1);
|
||||
REGISTER_DECODER(TEXT, text);
|
||||
REGISTER_DECODER(VPLAYER, vplayer);
|
||||
REGISTER_ENCDEC (WEBVTT, webvtt);
|
||||
REGISTER_ENCDEC (XSUB, xsub);
|
||||
|
||||
/* external libraries */
|
||||
REGISTER_DECODER(LIBCELT, libcelt);
|
||||
REGISTER_ENCODER(LIBFAAC, libfaac);
|
||||
REGISTER_ENCDEC (LIBFDK_AAC, libfdk_aac);
|
||||
REGISTER_ENCDEC (LIBGSM, libgsm);
|
||||
REGISTER_ENCDEC (LIBGSM_MS, libgsm_ms);
|
||||
REGISTER_ENCDEC (LIBILBC, libilbc);
|
||||
REGISTER_ENCODER(LIBMP3LAME, libmp3lame);
|
||||
REGISTER_ENCDEC (LIBOPENCORE_AMRNB, libopencore_amrnb);
|
||||
REGISTER_DECODER(LIBOPENCORE_AMRWB, libopencore_amrwb);
|
||||
REGISTER_ENCDEC (LIBOPENJPEG, libopenjpeg);
|
||||
REGISTER_ENCDEC (LIBOPUS, libopus);
|
||||
REGISTER_ENCDEC (LIBSCHROEDINGER, libschroedinger);
|
||||
REGISTER_ENCODER(LIBSHINE, libshine);
|
||||
REGISTER_ENCDEC (LIBSPEEX, libspeex);
|
||||
REGISTER_DECODER(LIBSTAGEFRIGHT_H264, libstagefright_h264);
|
||||
REGISTER_ENCODER(LIBTHEORA, libtheora);
|
||||
REGISTER_ENCODER(LIBTWOLAME, libtwolame);
|
||||
REGISTER_ENCDEC (LIBUTVIDEO, libutvideo);
|
||||
REGISTER_ENCODER(LIBVO_AACENC, libvo_aacenc);
|
||||
REGISTER_ENCODER(LIBVO_AMRWBENC, libvo_amrwbenc);
|
||||
REGISTER_ENCDEC (LIBVORBIS, libvorbis);
|
||||
REGISTER_ENCDEC (LIBVPX_VP8, libvpx_vp8);
|
||||
REGISTER_ENCDEC (LIBVPX_VP9, libvpx_vp9);
|
||||
REGISTER_ENCODER(LIBWAVPACK, libwavpack);
|
||||
REGISTER_ENCODER(LIBWEBP, libwebp);
|
||||
REGISTER_ENCODER(LIBX264, libx264);
|
||||
REGISTER_ENCODER(LIBX264RGB, libx264rgb);
|
||||
REGISTER_ENCODER(LIBX265, libx265);
|
||||
REGISTER_ENCODER(LIBXAVS, libxavs);
|
||||
REGISTER_ENCODER(LIBXVID, libxvid);
|
||||
REGISTER_DECODER(LIBZVBI_TELETEXT, libzvbi_teletext);
|
||||
REGISTER_ENCODER(LIBAACPLUS, libaacplus);
|
||||
|
||||
/* text */
|
||||
REGISTER_DECODER(BINTEXT, bintext);
|
||||
REGISTER_DECODER(XBIN, xbin);
|
||||
REGISTER_DECODER(IDF, idf);
|
||||
|
||||
/* parsers */
|
||||
REGISTER_PARSER(AAC, aac);
|
||||
REGISTER_PARSER(AAC_LATM, aac_latm);
|
||||
REGISTER_PARSER(AC3, ac3);
|
||||
REGISTER_PARSER(ADX, adx);
|
||||
REGISTER_PARSER(BMP, bmp);
|
||||
REGISTER_PARSER(CAVSVIDEO, cavsvideo);
|
||||
REGISTER_PARSER(COOK, cook);
|
||||
REGISTER_PARSER(DCA, dca);
|
||||
REGISTER_PARSER(DIRAC, dirac);
|
||||
REGISTER_PARSER(DNXHD, dnxhd);
|
||||
REGISTER_PARSER(DPX, dpx);
|
||||
REGISTER_PARSER(DVBSUB, dvbsub);
|
||||
REGISTER_PARSER(DVDSUB, dvdsub);
|
||||
REGISTER_PARSER(DVD_NAV, dvd_nav);
|
||||
REGISTER_PARSER(FLAC, flac);
|
||||
REGISTER_PARSER(GSM, gsm);
|
||||
REGISTER_PARSER(H261, h261);
|
||||
REGISTER_PARSER(H263, h263);
|
||||
REGISTER_PARSER(H264, h264);
|
||||
REGISTER_PARSER(HEVC, hevc);
|
||||
REGISTER_PARSER(MJPEG, mjpeg);
|
||||
REGISTER_PARSER(MLP, mlp);
|
||||
REGISTER_PARSER(MPEG4VIDEO, mpeg4video);
|
||||
REGISTER_PARSER(MPEGAUDIO, mpegaudio);
|
||||
REGISTER_PARSER(MPEGVIDEO, mpegvideo);
|
||||
REGISTER_PARSER(OPUS, opus);
|
||||
REGISTER_PARSER(PNG, png);
|
||||
REGISTER_PARSER(PNM, pnm);
|
||||
REGISTER_PARSER(RV30, rv30);
|
||||
REGISTER_PARSER(RV40, rv40);
|
||||
REGISTER_PARSER(TAK, tak);
|
||||
REGISTER_PARSER(VC1, vc1);
|
||||
REGISTER_PARSER(VORBIS, vorbis);
|
||||
REGISTER_PARSER(VP3, vp3);
|
||||
REGISTER_PARSER(VP8, vp8);
|
||||
REGISTER_PARSER(VP9, vp9);
|
||||
|
||||
/* bitstream filters */
|
||||
REGISTER_BSF(AAC_ADTSTOASC, aac_adtstoasc);
|
||||
REGISTER_BSF(CHOMP, chomp);
|
||||
REGISTER_BSF(DUMP_EXTRADATA, dump_extradata);
|
||||
REGISTER_BSF(H264_MP4TOANNEXB, h264_mp4toannexb);
|
||||
REGISTER_BSF(IMX_DUMP_HEADER, imx_dump_header);
|
||||
REGISTER_BSF(MJPEG2JPEG, mjpeg2jpeg);
|
||||
REGISTER_BSF(MJPEGA_DUMP_HEADER, mjpega_dump_header);
|
||||
REGISTER_BSF(MP3_HEADER_DECOMPRESS, mp3_header_decompress);
|
||||
REGISTER_BSF(MOV2TEXTSUB, mov2textsub);
|
||||
REGISTER_BSF(NOISE, noise);
|
||||
REGISTER_BSF(REMOVE_EXTRADATA, remove_extradata);
|
||||
REGISTER_BSF(TEXT2MOVSUB, text2movsub);
|
||||
}
|
|
@ -188,6 +188,7 @@ static void pred_weight_table(HEVCContext *s, GetBitContext *gb)
|
|||
s->sh.chroma_offset_l0[i][1] = 0;
|
||||
}
|
||||
}
|
||||
#ifdef USE_BIPRED
|
||||
if (s->sh.slice_type == B_SLICE) {
|
||||
for (i = 0; i < s->sh.nb_refs[L1]; i++) {
|
||||
luma_weight_l1_flag[i] = get_bits1(gb);
|
||||
|
@ -225,6 +226,7 @@ static void pred_weight_table(HEVCContext *s, GetBitContext *gb)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb)
|
||||
|
@ -1355,13 +1357,14 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride,
|
|||
|
||||
if (!weight_flag)
|
||||
s->hevcdsp.put_hevc_qpel_uni[idx][!!my][!!mx](dst, dststride, src, srcstride,
|
||||
block_h, mx, my, block_w);
|
||||
block_h, mx, my, block_w BIT_DEPTH_ARG2(s->sps->bit_depth));
|
||||
else
|
||||
s->hevcdsp.put_hevc_qpel_uni_w[idx][!!my][!!mx](dst, dststride, src, srcstride,
|
||||
block_h, s->sh.luma_log2_weight_denom,
|
||||
luma_weight, luma_offset, mx, my, block_w);
|
||||
luma_weight, luma_offset, mx, my, block_w BIT_DEPTH_ARG2(s->sps->bit_depth));
|
||||
}
|
||||
|
||||
#ifdef USE_BIPRED
|
||||
/**
|
||||
* 8.5.3.2.2.1 Luma sample bidirectional interpolation process
|
||||
*
|
||||
|
@ -1437,10 +1440,10 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride,
|
|||
}
|
||||
|
||||
s->hevcdsp.put_hevc_qpel[idx][!!my0][!!mx0](lc->tmp, src0, src0stride,
|
||||
block_h, mx0, my0, block_w);
|
||||
block_h, mx0, my0, block_w BIT_DEPTH_ARG2(s->sps->bit_depth));
|
||||
if (!weight_flag)
|
||||
s->hevcdsp.put_hevc_qpel_bi[idx][!!my1][!!mx1](dst, dststride, src1, src1stride, lc->tmp,
|
||||
block_h, mx1, my1, block_w);
|
||||
block_h, mx1, my1, block_w BIT_DEPTH_ARG2(s->sps->bit_depth));
|
||||
else
|
||||
s->hevcdsp.put_hevc_qpel_bi_w[idx][!!my1][!!mx1](dst, dststride, src1, src1stride, lc->tmp,
|
||||
block_h, s->sh.luma_log2_weight_denom,
|
||||
|
@ -1448,9 +1451,10 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride,
|
|||
s->sh.luma_weight_l1[current_mv->ref_idx[1]],
|
||||
s->sh.luma_offset_l0[current_mv->ref_idx[0]],
|
||||
s->sh.luma_offset_l1[current_mv->ref_idx[1]],
|
||||
mx1, my1, block_w);
|
||||
mx1, my1, block_w BIT_DEPTH_ARG2(s->sps->bit_depth));
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* 8.5.3.2.2.2 Chroma sample uniprediction interpolation process
|
||||
|
@ -1510,13 +1514,14 @@ static void chroma_mc_uni(HEVCContext *s, uint8_t *dst0,
|
|||
}
|
||||
if (!weight_flag)
|
||||
s->hevcdsp.put_hevc_epel_uni[idx][!!my][!!mx](dst0, dststride, src0, srcstride,
|
||||
block_h, _mx, _my, block_w);
|
||||
block_h, _mx, _my, block_w BIT_DEPTH_ARG2(s->sps->bit_depth));
|
||||
else
|
||||
s->hevcdsp.put_hevc_epel_uni_w[idx][!!my][!!mx](dst0, dststride, src0, srcstride,
|
||||
block_h, s->sh.chroma_log2_weight_denom,
|
||||
chroma_weight, chroma_offset, _mx, _my, block_w);
|
||||
chroma_weight, chroma_offset, _mx, _my, block_w BIT_DEPTH_ARG2(s->sps->bit_depth));
|
||||
}
|
||||
|
||||
#ifdef USE_BIPRED
|
||||
/**
|
||||
* 8.5.3.2.2.2 Chroma sample bidirectional interpolation process
|
||||
*
|
||||
|
@ -1607,11 +1612,11 @@ static void chroma_mc_bi(HEVCContext *s, uint8_t *dst0, ptrdiff_t dststride, AVF
|
|||
}
|
||||
|
||||
s->hevcdsp.put_hevc_epel[idx][!!my0][!!mx0](lc->tmp, src1, src1stride,
|
||||
block_h, _mx0, _my0, block_w);
|
||||
block_h, _mx0, _my0, block_w BIT_DEPTH_ARG2(s->sps->bit_depth));
|
||||
if (!weight_flag)
|
||||
s->hevcdsp.put_hevc_epel_bi[idx][!!my1][!!mx1](dst0, s->frame->linesize[cidx+1],
|
||||
src2, src2stride, lc->tmp,
|
||||
block_h, _mx1, _my1, block_w);
|
||||
block_h, _mx1, _my1, block_w BIT_DEPTH_ARG2(s->sps->bit_depth));
|
||||
else
|
||||
s->hevcdsp.put_hevc_epel_bi_w[idx][!!my1][!!mx1](dst0, s->frame->linesize[cidx+1],
|
||||
src2, src2stride, lc->tmp,
|
||||
|
@ -1621,9 +1626,10 @@ static void chroma_mc_bi(HEVCContext *s, uint8_t *dst0, ptrdiff_t dststride, AVF
|
|||
s->sh.chroma_weight_l1[current_mv->ref_idx[1]][cidx],
|
||||
s->sh.chroma_offset_l0[current_mv->ref_idx[0]][cidx],
|
||||
s->sh.chroma_offset_l1[current_mv->ref_idx[1]][cidx],
|
||||
_mx1, _my1, block_w);
|
||||
_mx1, _my1, block_w BIT_DEPTH_ARG2(s->sps->bit_depth));
|
||||
}
|
||||
#endif
|
||||
#endif /* USE_BIPRED */
|
||||
#endif /* USE_PRED */
|
||||
|
||||
#ifdef USE_FULL
|
||||
static void hevc_await_progress(HEVCContext *s, HEVCFrame *ref,
|
||||
|
@ -1754,65 +1760,78 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
|
|||
ref0 = refPicList[0].ref[current_mv.ref_idx[0]];
|
||||
if (!ref0)
|
||||
return;
|
||||
#ifdef USE_FULL
|
||||
hevc_await_progress(s, ref0, ¤t_mv.mv[0], y0, nPbH);
|
||||
#endif
|
||||
}
|
||||
if (current_mv.pred_flag & PF_L1) {
|
||||
ref1 = refPicList[1].ref[current_mv.ref_idx[1]];
|
||||
if (!ref1)
|
||||
return;
|
||||
#ifdef USE_FULL
|
||||
hevc_await_progress(s, ref1, ¤t_mv.mv[1], y0, nPbH);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (current_mv.pred_flag == PF_L0) {
|
||||
int x0_c = x0 >> s->sps->hshift[1];
|
||||
int y0_c = y0 >> s->sps->vshift[1];
|
||||
int nPbW_c = nPbW >> s->sps->hshift[1];
|
||||
int nPbH_c = nPbH >> s->sps->vshift[1];
|
||||
|
||||
luma_mc_uni(s, dst0, s->frame->linesize[0], ref0->frame,
|
||||
¤t_mv.mv[0], x0, y0, nPbW, nPbH,
|
||||
s->sh.luma_weight_l0[current_mv.ref_idx[0]],
|
||||
s->sh.luma_offset_l0[current_mv.ref_idx[0]]);
|
||||
|
||||
chroma_mc_uni(s, dst1, s->frame->linesize[1], ref0->frame->data[1], ref0->frame->linesize[1],
|
||||
0, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv,
|
||||
s->sh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0]);
|
||||
chroma_mc_uni(s, dst2, s->frame->linesize[2], ref0->frame->data[2], ref0->frame->linesize[2],
|
||||
0, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv,
|
||||
s->sh.chroma_weight_l0[current_mv.ref_idx[0]][1], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][1]);
|
||||
|
||||
if (s->sps->chroma_format_idc != 0) {
|
||||
int x0_c = x0 >> s->sps->hshift[1];
|
||||
int y0_c = y0 >> s->sps->vshift[1];
|
||||
int nPbW_c = nPbW >> s->sps->hshift[1];
|
||||
int nPbH_c = nPbH >> s->sps->vshift[1];
|
||||
|
||||
chroma_mc_uni(s, dst1, s->frame->linesize[1], ref0->frame->data[1], ref0->frame->linesize[1],
|
||||
0, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv,
|
||||
s->sh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0]);
|
||||
chroma_mc_uni(s, dst2, s->frame->linesize[2], ref0->frame->data[2], ref0->frame->linesize[2],
|
||||
0, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv,
|
||||
s->sh.chroma_weight_l0[current_mv.ref_idx[0]][1], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][1]);
|
||||
}
|
||||
} else if (current_mv.pred_flag == PF_L1) {
|
||||
int x0_c = x0 >> s->sps->hshift[1];
|
||||
int y0_c = y0 >> s->sps->vshift[1];
|
||||
int nPbW_c = nPbW >> s->sps->hshift[1];
|
||||
int nPbH_c = nPbH >> s->sps->vshift[1];
|
||||
|
||||
luma_mc_uni(s, dst0, s->frame->linesize[0], ref1->frame,
|
||||
¤t_mv.mv[1], x0, y0, nPbW, nPbH,
|
||||
s->sh.luma_weight_l1[current_mv.ref_idx[1]],
|
||||
s->sh.luma_offset_l1[current_mv.ref_idx[1]]);
|
||||
|
||||
chroma_mc_uni(s, dst1, s->frame->linesize[1], ref1->frame->data[1], ref1->frame->linesize[1],
|
||||
1, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv,
|
||||
s->sh.chroma_weight_l1[current_mv.ref_idx[1]][0], s->sh.chroma_offset_l1[current_mv.ref_idx[1]][0]);
|
||||
if (s->sps->chroma_format_idc != 0) {
|
||||
int x0_c = x0 >> s->sps->hshift[1];
|
||||
int y0_c = y0 >> s->sps->vshift[1];
|
||||
int nPbW_c = nPbW >> s->sps->hshift[1];
|
||||
int nPbH_c = nPbH >> s->sps->vshift[1];
|
||||
|
||||
chroma_mc_uni(s, dst2, s->frame->linesize[2], ref1->frame->data[2], ref1->frame->linesize[2],
|
||||
1, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv,
|
||||
s->sh.chroma_weight_l1[current_mv.ref_idx[1]][1], s->sh.chroma_offset_l1[current_mv.ref_idx[1]][1]);
|
||||
chroma_mc_uni(s, dst1, s->frame->linesize[1], ref1->frame->data[1], ref1->frame->linesize[1],
|
||||
1, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv,
|
||||
s->sh.chroma_weight_l1[current_mv.ref_idx[1]][0], s->sh.chroma_offset_l1[current_mv.ref_idx[1]][0]);
|
||||
|
||||
chroma_mc_uni(s, dst2, s->frame->linesize[2], ref1->frame->data[2], ref1->frame->linesize[2],
|
||||
1, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv,
|
||||
s->sh.chroma_weight_l1[current_mv.ref_idx[1]][1], s->sh.chroma_offset_l1[current_mv.ref_idx[1]][1]);
|
||||
}
|
||||
} else if (current_mv.pred_flag == PF_BI) {
|
||||
int x0_c = x0 >> s->sps->hshift[1];
|
||||
int y0_c = y0 >> s->sps->vshift[1];
|
||||
int nPbW_c = nPbW >> s->sps->hshift[1];
|
||||
int nPbH_c = nPbH >> s->sps->vshift[1];
|
||||
|
||||
#ifdef USE_BIPRED
|
||||
luma_mc_bi(s, dst0, s->frame->linesize[0], ref0->frame,
|
||||
¤t_mv.mv[0], x0, y0, nPbW, nPbH,
|
||||
ref1->frame, ¤t_mv.mv[1], ¤t_mv);
|
||||
|
||||
chroma_mc_bi(s, dst1, s->frame->linesize[1], ref0->frame, ref1->frame,
|
||||
x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, 0);
|
||||
|
||||
chroma_mc_bi(s, dst2, s->frame->linesize[2], ref0->frame, ref1->frame,
|
||||
x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, 1);
|
||||
if (s->sps->chroma_format_idc != 0) {
|
||||
int x0_c = x0 >> s->sps->hshift[1];
|
||||
int y0_c = y0 >> s->sps->vshift[1];
|
||||
int nPbW_c = nPbW >> s->sps->hshift[1];
|
||||
int nPbH_c = nPbH >> s->sps->vshift[1];
|
||||
|
||||
chroma_mc_bi(s, dst1, s->frame->linesize[1], ref0->frame, ref1->frame,
|
||||
x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, 0);
|
||||
|
||||
chroma_mc_bi(s, dst2, s->frame->linesize[2], ref0->frame, ref1->frame,
|
||||
x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, 1);
|
||||
}
|
||||
#else
|
||||
abort();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -2894,7 +2913,7 @@ int ff_hevc_extract_rbsp(HEVCContext *s, const uint8_t *src, int length,
|
|||
return length;
|
||||
}
|
||||
|
||||
av_fast_malloc(&nal->rbsp_buffer, &nal->rbsp_buffer_size,
|
||||
av_fast_malloc(&nal->rbsp_buffer, (unsigned int *)&nal->rbsp_buffer_size,
|
||||
length + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (!nal->rbsp_buffer)
|
||||
return AVERROR(ENOMEM);
|
||||
|
@ -3168,6 +3187,9 @@ static int hevc_decode_frame(AVCodecContext *avctx, void *data, int *got_output,
|
|||
}
|
||||
|
||||
s->ref = NULL;
|
||||
#ifdef USE_FRAME_DURATION_SEI
|
||||
s->frame_duration = 1;
|
||||
#endif
|
||||
ret = decode_nal_units(s, avpkt->data, avpkt->size);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
@ -3191,6 +3213,9 @@ static int hevc_decode_frame(AVCodecContext *avctx, void *data, int *got_output,
|
|||
}
|
||||
|
||||
if (s->output_frame->buf[0]) {
|
||||
#ifdef USE_FRAME_DURATION_SEI
|
||||
s->output_frame->pts = s->frame_duration;
|
||||
#endif
|
||||
av_frame_move_ref(data, s->output_frame);
|
||||
*got_output = 1;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,11 @@
|
|||
#ifdef USE_MSPS
|
||||
#define MAX_VPS_COUNT 16
|
||||
#define MAX_SPS_COUNT 32
|
||||
#ifdef USE_PRED
|
||||
#define MAX_DPB_COUNT 32
|
||||
#else
|
||||
#define MAX_DPB_COUNT 1
|
||||
#endif
|
||||
#else
|
||||
#define MAX_VPS_COUNT 1
|
||||
#define MAX_SPS_COUNT 1
|
||||
|
@ -944,6 +948,9 @@ typedef struct HEVCContext {
|
|||
int sei_hflip, sei_vflip;
|
||||
|
||||
int picture_struct;
|
||||
#ifdef USE_FRAME_DURATION_SEI
|
||||
uint16_t frame_duration;
|
||||
#endif
|
||||
} HEVCContext;
|
||||
|
||||
int ff_hevc_decode_short_term_rps(HEVCContext *s, ShortTermRPS *rps,
|
||||
|
|
|
@ -1,350 +0,0 @@
|
|||
/*
|
||||
* HEVC Annex B format parser
|
||||
*
|
||||
* Copyright (C) 2012 - 2013 Guillaume Martres
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "libavutil/common.h"
|
||||
|
||||
#include "parser.h"
|
||||
#include "hevc.h"
|
||||
#include "golomb.h"
|
||||
|
||||
#define START_CODE 0x000001 ///< start_code_prefix_one_3bytes
|
||||
|
||||
typedef struct HEVCParseContext {
|
||||
HEVCContext h;
|
||||
ParseContext pc;
|
||||
} HEVCParseContext;
|
||||
|
||||
/**
|
||||
* Find the end of the current frame in the bitstream.
|
||||
* @return the position of the first byte of the next frame, or END_NOT_FOUND
|
||||
*/
|
||||
static int hevc_find_frame_end(AVCodecParserContext *s, const uint8_t *buf,
|
||||
int buf_size)
|
||||
{
|
||||
int i;
|
||||
ParseContext *pc = &((HEVCParseContext *)s->priv_data)->pc;
|
||||
|
||||
for (i = 0; i < buf_size; i++) {
|
||||
int nut;
|
||||
|
||||
pc->state64 = (pc->state64 << 8) | buf[i];
|
||||
|
||||
if (((pc->state64 >> 3 * 8) & 0xFFFFFF) != START_CODE)
|
||||
continue;
|
||||
|
||||
nut = (pc->state64 >> 2 * 8 + 1) & 0x3F;
|
||||
// Beginning of access unit
|
||||
if ((nut >= NAL_VPS && nut <= NAL_AUD) || nut == NAL_SEI_PREFIX ||
|
||||
(nut >= 41 && nut <= 44) || (nut >= 48 && nut <= 55)) {
|
||||
if (pc->frame_start_found) {
|
||||
pc->frame_start_found = 0;
|
||||
return i - 5;
|
||||
}
|
||||
} else if (nut <= NAL_RASL_R ||
|
||||
(nut >= NAL_BLA_W_LP && nut <= NAL_CRA_NUT)) {
|
||||
int first_slice_segment_in_pic_flag = buf[i] >> 7;
|
||||
if (first_slice_segment_in_pic_flag) {
|
||||
if (!pc->frame_start_found) {
|
||||
pc->frame_start_found = 1;
|
||||
} else { // First slice of next frame found
|
||||
pc->frame_start_found = 0;
|
||||
return i - 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return END_NOT_FOUND;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse NAL units of found picture and decode some basic information.
|
||||
*
|
||||
* @param s parser context.
|
||||
* @param avctx codec context.
|
||||
* @param buf buffer with field/frame data.
|
||||
* @param buf_size size of the buffer.
|
||||
*/
|
||||
static inline int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx,
|
||||
const uint8_t *buf, int buf_size)
|
||||
{
|
||||
HEVCContext *h = &((HEVCParseContext *)s->priv_data)->h;
|
||||
GetBitContext *gb = &h->HEVClc->gb;
|
||||
SliceHeader *sh = &h->sh;
|
||||
const uint8_t *buf_end = buf + buf_size;
|
||||
int state = -1, i;
|
||||
HEVCNAL *nal;
|
||||
|
||||
/* set some sane default values */
|
||||
s->pict_type = AV_PICTURE_TYPE_I;
|
||||
s->key_frame = 0;
|
||||
s->picture_structure = AV_PICTURE_STRUCTURE_UNKNOWN;
|
||||
|
||||
h->avctx = avctx;
|
||||
|
||||
if (!buf_size)
|
||||
return 0;
|
||||
|
||||
if (h->nals_allocated < 1) {
|
||||
HEVCNAL *tmp = av_realloc_array(h->nals, 1, sizeof(*tmp));
|
||||
if (!tmp)
|
||||
return AVERROR(ENOMEM);
|
||||
h->nals = tmp;
|
||||
memset(h->nals, 0, sizeof(*tmp));
|
||||
h->nals_allocated = 1;
|
||||
}
|
||||
|
||||
nal = &h->nals[0];
|
||||
|
||||
for (;;) {
|
||||
int src_length, consumed;
|
||||
buf = avpriv_find_start_code(buf, buf_end, &state);
|
||||
if (--buf + 2 >= buf_end)
|
||||
break;
|
||||
src_length = buf_end - buf;
|
||||
|
||||
h->nal_unit_type = (*buf >> 1) & 0x3f;
|
||||
h->temporal_id = (*(buf + 1) & 0x07) - 1;
|
||||
if (h->nal_unit_type <= NAL_CRA_NUT) {
|
||||
// Do not walk the whole buffer just to decode slice segment header
|
||||
if (src_length > 20)
|
||||
src_length = 20;
|
||||
}
|
||||
|
||||
consumed = ff_hevc_extract_rbsp(h, buf, src_length, nal);
|
||||
if (consumed < 0)
|
||||
return consumed;
|
||||
|
||||
init_get_bits8(gb, nal->data + 2, nal->size);
|
||||
switch (h->nal_unit_type) {
|
||||
case NAL_VPS:
|
||||
ff_hevc_decode_nal_vps(h);
|
||||
break;
|
||||
case NAL_SPS:
|
||||
ff_hevc_decode_nal_sps(h);
|
||||
break;
|
||||
case NAL_PPS:
|
||||
ff_hevc_decode_nal_pps(h);
|
||||
break;
|
||||
case NAL_SEI_PREFIX:
|
||||
case NAL_SEI_SUFFIX:
|
||||
ff_hevc_decode_nal_sei(h);
|
||||
break;
|
||||
case NAL_TRAIL_N:
|
||||
case NAL_TRAIL_R:
|
||||
case NAL_TSA_N:
|
||||
case NAL_TSA_R:
|
||||
case NAL_STSA_N:
|
||||
case NAL_STSA_R:
|
||||
case NAL_RADL_N:
|
||||
case NAL_RADL_R:
|
||||
case NAL_RASL_N:
|
||||
case NAL_RASL_R:
|
||||
case NAL_BLA_W_LP:
|
||||
case NAL_BLA_W_RADL:
|
||||
case NAL_BLA_N_LP:
|
||||
case NAL_IDR_W_RADL:
|
||||
case NAL_IDR_N_LP:
|
||||
case NAL_CRA_NUT:
|
||||
sh->first_slice_in_pic_flag = get_bits1(gb);
|
||||
s->picture_structure = h->picture_struct;
|
||||
s->field_order = h->picture_struct;
|
||||
|
||||
if (IS_IRAP(h)) {
|
||||
s->key_frame = 1;
|
||||
sh->no_output_of_prior_pics_flag = get_bits1(gb);
|
||||
}
|
||||
|
||||
sh->pps_id = get_ue_golomb(gb);
|
||||
if (sh->pps_id >= MAX_PPS_COUNT || !h->pps_list[sh->pps_id]) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "PPS id out of range: %d\n", sh->pps_id);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
h->pps = (HEVCPPS*)h->pps_list[sh->pps_id]->data;
|
||||
|
||||
if (h->pps->sps_id >= MAX_SPS_COUNT || !h->sps_list[h->pps->sps_id]) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "SPS id out of range: %d\n", h->pps->sps_id);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (h->sps != (HEVCSPS*)h->sps_list[h->pps->sps_id]->data) {
|
||||
h->sps = (HEVCSPS*)h->sps_list[h->pps->sps_id]->data;
|
||||
h->vps = (HEVCVPS*)h->vps_list[h->sps->vps_id]->data;
|
||||
}
|
||||
|
||||
if (!sh->first_slice_in_pic_flag) {
|
||||
int slice_address_length;
|
||||
|
||||
if (h->pps->dependent_slice_segments_enabled_flag)
|
||||
sh->dependent_slice_segment_flag = get_bits1(gb);
|
||||
else
|
||||
sh->dependent_slice_segment_flag = 0;
|
||||
|
||||
slice_address_length = av_ceil_log2_c(h->sps->ctb_width *
|
||||
h->sps->ctb_height);
|
||||
sh->slice_segment_addr = get_bits(gb, slice_address_length);
|
||||
if (sh->slice_segment_addr >= h->sps->ctb_width * h->sps->ctb_height) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "Invalid slice segment address: %u.\n",
|
||||
sh->slice_segment_addr);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
} else
|
||||
sh->dependent_slice_segment_flag = 0;
|
||||
|
||||
if (sh->dependent_slice_segment_flag)
|
||||
break;
|
||||
|
||||
for (i = 0; i < h->pps->num_extra_slice_header_bits; i++)
|
||||
skip_bits(gb, 1); // slice_reserved_undetermined_flag[]
|
||||
|
||||
sh->slice_type = get_ue_golomb(gb);
|
||||
if (!(sh->slice_type == I_SLICE || sh->slice_type == P_SLICE ||
|
||||
sh->slice_type == B_SLICE)) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "Unknown slice type: %d.\n",
|
||||
sh->slice_type);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
s->pict_type = sh->slice_type == B_SLICE ? AV_PICTURE_TYPE_B :
|
||||
sh->slice_type == P_SLICE ? AV_PICTURE_TYPE_P :
|
||||
AV_PICTURE_TYPE_I;
|
||||
|
||||
if (h->pps->output_flag_present_flag)
|
||||
sh->pic_output_flag = get_bits1(gb);
|
||||
|
||||
if (h->sps->separate_colour_plane_flag)
|
||||
sh->colour_plane_id = get_bits(gb, 2);
|
||||
|
||||
if (!IS_IDR(h)) {
|
||||
sh->pic_order_cnt_lsb = get_bits(gb, h->sps->log2_max_poc_lsb);
|
||||
s->output_picture_number = h->poc = ff_hevc_compute_poc(h, sh->pic_order_cnt_lsb);
|
||||
} else
|
||||
s->output_picture_number = h->poc = 0;
|
||||
|
||||
if (h->temporal_id == 0 &&
|
||||
h->nal_unit_type != NAL_TRAIL_N &&
|
||||
h->nal_unit_type != NAL_TSA_N &&
|
||||
h->nal_unit_type != NAL_STSA_N &&
|
||||
h->nal_unit_type != NAL_RADL_N &&
|
||||
h->nal_unit_type != NAL_RASL_N &&
|
||||
h->nal_unit_type != NAL_RADL_R &&
|
||||
h->nal_unit_type != NAL_RASL_R)
|
||||
h->pocTid0 = h->poc;
|
||||
|
||||
return 0; /* no need to evaluate the rest */
|
||||
}
|
||||
buf += consumed;
|
||||
}
|
||||
/* didn't find a picture! */
|
||||
av_log(h->avctx, AV_LOG_ERROR, "missing picture in access unit\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int hevc_parse(AVCodecParserContext *s,
|
||||
AVCodecContext *avctx,
|
||||
const uint8_t **poutbuf, int *poutbuf_size,
|
||||
const uint8_t *buf, int buf_size)
|
||||
{
|
||||
int next;
|
||||
ParseContext *pc = &((HEVCParseContext *)s->priv_data)->pc;
|
||||
|
||||
if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
|
||||
next = buf_size;
|
||||
} else {
|
||||
next = hevc_find_frame_end(s, buf, buf_size);
|
||||
if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
|
||||
*poutbuf = NULL;
|
||||
*poutbuf_size = 0;
|
||||
return buf_size;
|
||||
}
|
||||
}
|
||||
|
||||
parse_nal_units(s, avctx, buf, buf_size);
|
||||
|
||||
*poutbuf = buf;
|
||||
*poutbuf_size = buf_size;
|
||||
return next;
|
||||
}
|
||||
|
||||
// Split after the parameter sets at the beginning of the stream if they exist.
|
||||
static int hevc_split(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
|
||||
{
|
||||
int i;
|
||||
uint32_t state = -1;
|
||||
int has_ps = 0;
|
||||
|
||||
for (i = 0; i < buf_size; i++) {
|
||||
state = (state << 8) | buf[i];
|
||||
if (((state >> 8) & 0xFFFFFF) == START_CODE) {
|
||||
int nut = (state >> 1) & 0x3F;
|
||||
if (nut >= NAL_VPS && nut <= NAL_PPS)
|
||||
has_ps = 1;
|
||||
else if (has_ps)
|
||||
return i - 3;
|
||||
else // no parameter set at the beginning of the stream
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int hevc_init(AVCodecParserContext *s)
|
||||
{
|
||||
HEVCContext *h = &((HEVCParseContext *)s->priv_data)->h;
|
||||
h->HEVClc = av_mallocz(sizeof(HEVCLocalContext));
|
||||
h->skipped_bytes_pos_size = INT_MAX;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void hevc_close(AVCodecParserContext *s)
|
||||
{
|
||||
int i;
|
||||
HEVCContext *h = &((HEVCParseContext *)s->priv_data)->h;
|
||||
ParseContext *pc = &((HEVCParseContext *)s->priv_data)->pc;
|
||||
|
||||
av_freep(&h->skipped_bytes_pos);
|
||||
av_freep(&h->HEVClc);
|
||||
av_freep(&pc->buffer);
|
||||
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(h->vps_list); i++)
|
||||
av_buffer_unref(&h->vps_list[i]);
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(h->sps_list); i++)
|
||||
av_buffer_unref(&h->sps_list[i]);
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(h->pps_list); i++)
|
||||
av_buffer_unref(&h->pps_list[i]);
|
||||
|
||||
av_buffer_unref(&h->current_sps);
|
||||
h->sps = NULL;
|
||||
|
||||
for (i = 0; i < h->nals_allocated; i++)
|
||||
av_freep(&h->nals[i].rbsp_buffer);
|
||||
av_freep(&h->nals);
|
||||
h->nals_allocated = 0;
|
||||
}
|
||||
|
||||
AVCodecParser ff_hevc_parser = {
|
||||
.codec_ids = { AV_CODEC_ID_HEVC },
|
||||
.priv_data_size = sizeof(HEVCParseContext),
|
||||
.parser_init = hevc_init,
|
||||
.parser_parse = hevc_parse,
|
||||
.parser_close = hevc_close,
|
||||
.split = hevc_split,
|
||||
};
|
|
@ -49,27 +49,7 @@ static const uint8_t default_scaling_list_inter[] = {
|
|||
24, 25, 28, 33, 41, 54, 71, 91
|
||||
};
|
||||
|
||||
#ifndef USE_MSPS
|
||||
static const AVRational vui_sar[] = {
|
||||
{ 0, 1 },
|
||||
{ 1, 1 },
|
||||
{ 12, 11 },
|
||||
{ 10, 11 },
|
||||
{ 16, 11 },
|
||||
{ 40, 33 },
|
||||
{ 24, 11 },
|
||||
{ 20, 11 },
|
||||
{ 32, 11 },
|
||||
{ 80, 33 },
|
||||
{ 18, 11 },
|
||||
{ 15, 11 },
|
||||
{ 64, 33 },
|
||||
{ 160, 99 },
|
||||
{ 4, 3 },
|
||||
{ 3, 2 },
|
||||
{ 2, 1 },
|
||||
};
|
||||
|
||||
#ifdef USE_PRED
|
||||
int ff_hevc_decode_short_term_rps(HEVCContext *s, ShortTermRPS *rps,
|
||||
const HEVCSPS *sps, int is_slice_header)
|
||||
{
|
||||
|
@ -198,6 +178,28 @@ int ff_hevc_decode_short_term_rps(HEVCContext *s, ShortTermRPS *rps,
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef USE_MSPS
|
||||
static const AVRational vui_sar[] = {
|
||||
{ 0, 1 },
|
||||
{ 1, 1 },
|
||||
{ 12, 11 },
|
||||
{ 10, 11 },
|
||||
{ 16, 11 },
|
||||
{ 40, 33 },
|
||||
{ 24, 11 },
|
||||
{ 20, 11 },
|
||||
{ 32, 11 },
|
||||
{ 80, 33 },
|
||||
{ 18, 11 },
|
||||
{ 15, 11 },
|
||||
{ 64, 33 },
|
||||
{ 160, 99 },
|
||||
{ 4, 3 },
|
||||
{ 3, 2 },
|
||||
{ 2, 1 },
|
||||
};
|
||||
|
||||
static int decode_profile_tier_level(HEVCContext *s, PTLCommon *ptl)
|
||||
{
|
||||
|
@ -978,7 +980,7 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
|
|||
|
||||
|
||||
#ifdef USE_MSPS
|
||||
sps->log2_max_poc_lsb = 8; /* not used */
|
||||
sps->log2_max_poc_lsb = 8; /* not used for intra */
|
||||
for (i = 0; i < sps->max_sub_layers; i++) {
|
||||
sps->temporal_layer[i].max_dec_pic_buffering = 1;
|
||||
sps->temporal_layer[i].num_reorder_pics = 0;
|
||||
|
@ -1045,13 +1047,14 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
|
|||
goto err;
|
||||
}
|
||||
#ifdef USE_MSPS
|
||||
sps->max_transform_hierarchy_depth_inter = 0; /* not used for intra */
|
||||
sps->max_transform_hierarchy_depth_intra = get_ue_golomb_long(gb);
|
||||
sps->max_transform_hierarchy_depth_inter =
|
||||
sps->max_transform_hierarchy_depth_intra; /* not used for intra */
|
||||
sps->amp_enabled_flag = 1; /* not used for intra */
|
||||
#else
|
||||
sps->max_transform_hierarchy_depth_inter = get_ue_golomb_long(gb);
|
||||
#endif
|
||||
sps->max_transform_hierarchy_depth_intra = get_ue_golomb_long(gb);
|
||||
|
||||
#ifndef USE_MSPS
|
||||
sps->scaling_list_enable_flag = get_bits1(gb);
|
||||
if (sps->scaling_list_enable_flag) {
|
||||
#ifdef USE_FULL
|
||||
|
@ -1092,7 +1095,7 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
|
|||
#ifdef USE_MSPS
|
||||
sps->nb_st_rps = 0; /* not used for intra */
|
||||
sps->long_term_ref_pics_present_flag = 0; /* not used for intra */
|
||||
sps->sps_temporal_mvp_enabled_flag = 0; /* not used for intra */
|
||||
sps->sps_temporal_mvp_enabled_flag = 1; /* not used for intra */
|
||||
sps->sps_strong_intra_smoothing_enable_flag = get_bits1(gb);
|
||||
sps->vui.sar = (AVRational){0, 1};
|
||||
#else
|
||||
|
|
|
@ -177,6 +177,12 @@ static int decode_nal_sei_message(HEVCContext *s)
|
|||
active_parameter_sets(s);
|
||||
av_log(s->avctx, AV_LOG_DEBUG, "Skipped PREFIX SEI %d\n", payload_type);
|
||||
} else
|
||||
#endif
|
||||
#ifdef USE_FRAME_DURATION_SEI
|
||||
if (payload_type == 257) {
|
||||
/* frame duration in multiples of the frame rate period */
|
||||
s->frame_duration = get_bits(gb, 16);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
av_log(s->avctx, AV_LOG_DEBUG, "Skipped PREFIX SEI %d\n", payload_type);
|
||||
|
|
|
@ -238,45 +238,31 @@ void ff_hevc_dsp_init(HEVCDSPContext *hevcdsp, int bit_depth)
|
|||
PEL_FUNC(put_hevc_qpel_bi_w, 1, 1, put_hevc_qpel_bi_w_hv, depth)
|
||||
|
||||
#ifdef USE_PRED
|
||||
#define HEVC_DSP(depth) \
|
||||
hevcdsp->put_pcm = FUNC(put_pcm, depth); \
|
||||
hevcdsp->transform_add[0] = FUNC(transform_add4x4, depth); \
|
||||
hevcdsp->transform_add[1] = FUNC(transform_add8x8, depth); \
|
||||
hevcdsp->transform_add[2] = FUNC(transform_add16x16, depth); \
|
||||
hevcdsp->transform_add[3] = FUNC(transform_add32x32, depth); \
|
||||
hevcdsp->transform_skip = FUNC(transform_skip, depth); \
|
||||
hevcdsp->transform_rdpcm = FUNC(transform_rdpcm, depth); \
|
||||
hevcdsp->idct_4x4_luma = FUNC(transform_4x4_luma, depth); \
|
||||
hevcdsp->idct[0] = FUNC(idct_4x4, depth); \
|
||||
hevcdsp->idct[1] = FUNC(idct_8x8, depth); \
|
||||
hevcdsp->idct[2] = FUNC(idct_16x16, depth); \
|
||||
hevcdsp->idct[3] = FUNC(idct_32x32, depth); \
|
||||
\
|
||||
hevcdsp->idct_dc[0] = FUNC(idct_4x4_dc, depth); \
|
||||
hevcdsp->idct_dc[1] = FUNC(idct_8x8_dc, depth); \
|
||||
hevcdsp->idct_dc[2] = FUNC(idct_16x16_dc, depth); \
|
||||
hevcdsp->idct_dc[3] = FUNC(idct_32x32_dc, depth); \
|
||||
\
|
||||
hevcdsp->sao_band_filter = FUNC(sao_band_filter_0, depth); \
|
||||
hevcdsp->sao_edge_filter[0] = FUNC(sao_edge_filter_0, depth); \
|
||||
hevcdsp->sao_edge_filter[1] = FUNC(sao_edge_filter_1, depth); \
|
||||
\
|
||||
|
||||
#ifdef USE_BIPRED
|
||||
|
||||
#define HEVC_DSP_PRED(depth) \
|
||||
QPEL_FUNCS(depth); \
|
||||
QPEL_UNI_FUNCS(depth); \
|
||||
QPEL_BI_FUNCS(depth); \
|
||||
EPEL_FUNCS(depth); \
|
||||
EPEL_UNI_FUNCS(depth); \
|
||||
EPEL_BI_FUNCS(depth); \
|
||||
\
|
||||
hevcdsp->hevc_h_loop_filter_luma = FUNC(hevc_h_loop_filter_luma, depth); \
|
||||
hevcdsp->hevc_v_loop_filter_luma = FUNC(hevc_v_loop_filter_luma, depth); \
|
||||
hevcdsp->hevc_h_loop_filter_chroma = FUNC(hevc_h_loop_filter_chroma, depth); \
|
||||
hevcdsp->hevc_v_loop_filter_chroma = FUNC(hevc_v_loop_filter_chroma, depth); \
|
||||
hevcdsp->hevc_h_loop_filter_luma_c = FUNC(hevc_h_loop_filter_luma, depth); \
|
||||
hevcdsp->hevc_v_loop_filter_luma_c = FUNC(hevc_v_loop_filter_luma, depth); \
|
||||
hevcdsp->hevc_h_loop_filter_chroma_c = FUNC(hevc_h_loop_filter_chroma, depth); \
|
||||
hevcdsp->hevc_v_loop_filter_chroma_c = FUNC(hevc_v_loop_filter_chroma, depth)
|
||||
EPEL_BI_FUNCS(depth);
|
||||
|
||||
#else
|
||||
|
||||
#define HEVC_DSP_PRED(depth) \
|
||||
QPEL_UNI_FUNCS(depth); \
|
||||
EPEL_UNI_FUNCS(depth);
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#define HEVC_DSP_PRED(depth)
|
||||
|
||||
#endif
|
||||
|
||||
#define HEVC_DSP(depth) \
|
||||
hevcdsp->put_pcm = FUNC(put_pcm, depth); \
|
||||
hevcdsp->transform_add[0] = FUNC(transform_add4x4, depth); \
|
||||
|
@ -295,7 +281,7 @@ void ff_hevc_dsp_init(HEVCDSPContext *hevcdsp, int bit_depth)
|
|||
hevcdsp->idct_dc[1] = FUNC(idct_8x8_dc, depth); \
|
||||
hevcdsp->idct_dc[2] = FUNC(idct_16x16_dc, depth); \
|
||||
hevcdsp->idct_dc[3] = FUNC(idct_32x32_dc, depth); \
|
||||
\
|
||||
HEVC_DSP_PRED(depth) \
|
||||
hevcdsp->sao_band_filter = FUNC(sao_band_filter_0, depth); \
|
||||
hevcdsp->sao_edge_filter[0] = FUNC(sao_edge_filter_0, depth); \
|
||||
hevcdsp->sao_edge_filter[1] = FUNC(sao_edge_filter_1, depth); \
|
||||
|
@ -308,7 +294,6 @@ void ff_hevc_dsp_init(HEVCDSPContext *hevcdsp, int bit_depth)
|
|||
hevcdsp->hevc_v_loop_filter_luma_c = FUNC(hevc_v_loop_filter_luma, depth); \
|
||||
hevcdsp->hevc_h_loop_filter_chroma_c = FUNC(hevc_h_loop_filter_chroma, depth); \
|
||||
hevcdsp->hevc_v_loop_filter_chroma_c = FUNC(hevc_v_loop_filter_chroma, depth)
|
||||
#endif
|
||||
|
||||
#ifdef USE_PRED
|
||||
int i = 0;
|
||||
|
|
|
@ -78,33 +78,33 @@ typedef struct HEVCDSPContext {
|
|||
uint8_t *horiz_edge, uint8_t *diag_edge BIT_DEPTH_PARAM);
|
||||
|
||||
void (*put_hevc_qpel[10][2][2])(int16_t *dst, uint8_t *src, ptrdiff_t srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width);
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM);
|
||||
void (*put_hevc_qpel_uni[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width);
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM);
|
||||
void (*put_hevc_qpel_uni_w[10][2][2])(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);
|
||||
int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM);
|
||||
|
||||
void (*put_hevc_qpel_bi[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int16_t *src2,
|
||||
int height, intptr_t mx, intptr_t my, int width);
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM);
|
||||
void (*put_hevc_qpel_bi_w[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int16_t *src2,
|
||||
int height, int denom, int wx0, int wx1,
|
||||
int ox0, int ox1, intptr_t mx, intptr_t my, int width);
|
||||
int ox0, int ox1, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM);
|
||||
void (*put_hevc_epel[10][2][2])(int16_t *dst, uint8_t *src, ptrdiff_t srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width);
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM);
|
||||
|
||||
void (*put_hevc_epel_uni[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width);
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM);
|
||||
void (*put_hevc_epel_uni_w[10][2][2])(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);
|
||||
int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM);
|
||||
void (*put_hevc_epel_bi[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int16_t *src2,
|
||||
int height, intptr_t mx, intptr_t my, int width);
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM);
|
||||
void (*put_hevc_epel_bi_w[10][2][2])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int16_t *src2,
|
||||
int height, int denom, int wx0, int ox0, int wx1,
|
||||
int ox1, intptr_t mx, intptr_t my, int width);
|
||||
int ox1, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM);
|
||||
|
||||
void (*hevc_h_loop_filter_luma)(uint8_t *pix, ptrdiff_t stride,
|
||||
int beta, int32_t *tc,
|
||||
|
|
|
@ -544,9 +544,10 @@ static void FUNC(sao_edge_filter_1)(uint8_t *_dst, uint8_t *_src,
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#ifdef USE_BIPRED
|
||||
static void FUNC(put_hevc_pel_pixels)(int16_t *dst,
|
||||
uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width)
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel *)_src;
|
||||
|
@ -559,9 +560,10 @@ static void FUNC(put_hevc_pel_pixels)(int16_t *dst,
|
|||
dst += MAX_PB_SIZE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void FUNC(put_hevc_pel_uni_pixels)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width)
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int y;
|
||||
pixel *src = (pixel *)_src;
|
||||
|
@ -576,9 +578,10 @@ static void FUNC(put_hevc_pel_uni_pixels)(uint8_t *_dst, ptrdiff_t _dststride, u
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef USE_BIPRED
|
||||
static void FUNC(put_hevc_pel_bi_pixels)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int16_t *src2,
|
||||
int height, intptr_t mx, intptr_t my, int width)
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel *)_src;
|
||||
|
@ -587,11 +590,7 @@ static void FUNC(put_hevc_pel_bi_pixels)(uint8_t *_dst, ptrdiff_t _dststride, ui
|
|||
ptrdiff_t dststride = _dststride / sizeof(pixel);
|
||||
|
||||
int shift = 14 + 1 - BIT_DEPTH;
|
||||
#if BIT_DEPTH < 14
|
||||
int offset = 1 << (shift - 1);
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
int offset = (1 << shift) >> 1;
|
||||
|
||||
for (y = 0; y < height; y++) {
|
||||
for (x = 0; x < width; x++)
|
||||
|
@ -601,9 +600,10 @@ static void FUNC(put_hevc_pel_bi_pixels)(uint8_t *_dst, ptrdiff_t _dststride, ui
|
|||
src2 += MAX_PB_SIZE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void FUNC(put_hevc_pel_uni_w_pixels)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width)
|
||||
int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel *)_src;
|
||||
|
@ -611,11 +611,7 @@ static void FUNC(put_hevc_pel_uni_w_pixels)(uint8_t *_dst, ptrdiff_t _dststride,
|
|||
pixel *dst = (pixel *)_dst;
|
||||
ptrdiff_t dststride = _dststride / sizeof(pixel);
|
||||
int shift = denom + 14 - BIT_DEPTH;
|
||||
#if BIT_DEPTH < 14
|
||||
int offset = 1 << (shift - 1);
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
int offset = (1 << shift) >> 1;
|
||||
|
||||
ox = ox * (1 << (BIT_DEPTH - 8));
|
||||
for (y = 0; y < height; y++) {
|
||||
|
@ -626,10 +622,11 @@ static void FUNC(put_hevc_pel_uni_w_pixels)(uint8_t *_dst, ptrdiff_t _dststride,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef USE_BIPRED
|
||||
static void FUNC(put_hevc_pel_bi_w_pixels)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int16_t *src2,
|
||||
int height, int denom, int wx0, int wx1,
|
||||
int ox0, int ox1, intptr_t mx, intptr_t my, int width)
|
||||
int ox0, int ox1, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel *)_src;
|
||||
|
@ -651,6 +648,7 @@ static void FUNC(put_hevc_pel_bi_w_pixels)(uint8_t *_dst, ptrdiff_t _dststride,
|
|||
src2 += MAX_PB_SIZE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
@ -665,9 +663,10 @@ static void FUNC(put_hevc_pel_bi_w_pixels)(uint8_t *_dst, ptrdiff_t _dststride,
|
|||
filter[6] * src[x + 3 * stride] + \
|
||||
filter[7] * src[x + 4 * stride])
|
||||
|
||||
#ifdef USE_BIPRED
|
||||
static void FUNC(put_hevc_qpel_h)(int16_t *dst,
|
||||
uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width)
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel*)_src;
|
||||
|
@ -683,7 +682,7 @@ static void FUNC(put_hevc_qpel_h)(int16_t *dst,
|
|||
|
||||
static void FUNC(put_hevc_qpel_v)(int16_t *dst,
|
||||
uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width)
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel*)_src;
|
||||
|
@ -701,7 +700,7 @@ static void FUNC(put_hevc_qpel_hv)(int16_t *dst,
|
|||
uint8_t *_src,
|
||||
ptrdiff_t _srcstride,
|
||||
int height, intptr_t mx,
|
||||
intptr_t my, int width)
|
||||
intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
const int8_t *filter;
|
||||
|
@ -728,10 +727,11 @@ static void FUNC(put_hevc_qpel_hv)(int16_t *dst,
|
|||
dst += MAX_PB_SIZE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void FUNC(put_hevc_qpel_uni_h)(uint8_t *_dst, ptrdiff_t _dststride,
|
||||
uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width)
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel*)_src;
|
||||
|
@ -740,12 +740,7 @@ static void FUNC(put_hevc_qpel_uni_h)(uint8_t *_dst, ptrdiff_t _dststride,
|
|||
ptrdiff_t dststride = _dststride / sizeof(pixel);
|
||||
const int8_t *filter = ff_hevc_qpel_filters[mx - 1];
|
||||
int shift = 14 - BIT_DEPTH;
|
||||
|
||||
#if BIT_DEPTH < 14
|
||||
int offset = 1 << (shift - 1);
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
int offset = (1 << shift) >> 1;
|
||||
|
||||
for (y = 0; y < height; y++) {
|
||||
for (x = 0; x < width; x++)
|
||||
|
@ -755,9 +750,10 @@ static void FUNC(put_hevc_qpel_uni_h)(uint8_t *_dst, ptrdiff_t _dststride,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef USE_BIPRED
|
||||
static void FUNC(put_hevc_qpel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int16_t *src2,
|
||||
int height, intptr_t mx, intptr_t my, int width)
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel*)_src;
|
||||
|
@ -768,11 +764,7 @@ static void FUNC(put_hevc_qpel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_
|
|||
const int8_t *filter = ff_hevc_qpel_filters[mx - 1];
|
||||
|
||||
int shift = 14 + 1 - BIT_DEPTH;
|
||||
#if BIT_DEPTH < 14
|
||||
int offset = 1 << (shift - 1);
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
int offset = (1 << shift) >> 1;
|
||||
|
||||
for (y = 0; y < height; y++) {
|
||||
for (x = 0; x < width; x++)
|
||||
|
@ -782,10 +774,11 @@ static void FUNC(put_hevc_qpel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_
|
|||
src2 += MAX_PB_SIZE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void FUNC(put_hevc_qpel_uni_v)(uint8_t *_dst, ptrdiff_t _dststride,
|
||||
uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width)
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel*)_src;
|
||||
|
@ -794,12 +787,8 @@ static void FUNC(put_hevc_qpel_uni_v)(uint8_t *_dst, ptrdiff_t _dststride,
|
|||
ptrdiff_t dststride = _dststride / sizeof(pixel);
|
||||
const int8_t *filter = ff_hevc_qpel_filters[my - 1];
|
||||
int shift = 14 - BIT_DEPTH;
|
||||
int offset = (1 << shift) >> 1;
|
||||
|
||||
#if BIT_DEPTH < 14
|
||||
int offset = 1 << (shift - 1);
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
|
||||
for (y = 0; y < height; y++) {
|
||||
for (x = 0; x < width; x++)
|
||||
|
@ -810,9 +799,10 @@ static void FUNC(put_hevc_qpel_uni_v)(uint8_t *_dst, ptrdiff_t _dststride,
|
|||
}
|
||||
|
||||
|
||||
#ifdef USE_BIPRED
|
||||
static void FUNC(put_hevc_qpel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int16_t *src2,
|
||||
int height, intptr_t mx, intptr_t my, int width)
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel*)_src;
|
||||
|
@ -823,11 +813,7 @@ static void FUNC(put_hevc_qpel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_
|
|||
const int8_t *filter = ff_hevc_qpel_filters[my - 1];
|
||||
|
||||
int shift = 14 + 1 - BIT_DEPTH;
|
||||
#if BIT_DEPTH < 14
|
||||
int offset = 1 << (shift - 1);
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
int offset = (1 << shift) >> 1;
|
||||
|
||||
for (y = 0; y < height; y++) {
|
||||
for (x = 0; x < width; x++)
|
||||
|
@ -837,10 +823,11 @@ static void FUNC(put_hevc_qpel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_
|
|||
src2 += MAX_PB_SIZE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void FUNC(put_hevc_qpel_uni_hv)(uint8_t *_dst, ptrdiff_t _dststride,
|
||||
uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width)
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
const int8_t *filter;
|
||||
|
@ -851,12 +838,7 @@ static void FUNC(put_hevc_qpel_uni_hv)(uint8_t *_dst, ptrdiff_t _dststride,
|
|||
int16_t tmp_array[(MAX_PB_SIZE + QPEL_EXTRA) * MAX_PB_SIZE];
|
||||
int16_t *tmp = tmp_array;
|
||||
int shift = 14 - BIT_DEPTH;
|
||||
|
||||
#if BIT_DEPTH < 14
|
||||
int offset = 1 << (shift - 1);
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
int offset = (1 << shift) >> 1;
|
||||
|
||||
src -= QPEL_EXTRA_BEFORE * srcstride;
|
||||
filter = ff_hevc_qpel_filters[mx - 1];
|
||||
|
@ -878,9 +860,10 @@ static void FUNC(put_hevc_qpel_uni_hv)(uint8_t *_dst, ptrdiff_t _dststride,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef USE_BIPRED
|
||||
static void FUNC(put_hevc_qpel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int16_t *src2,
|
||||
int height, intptr_t mx, intptr_t my, int width)
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
const int8_t *filter;
|
||||
|
@ -891,11 +874,7 @@ static void FUNC(put_hevc_qpel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8
|
|||
int16_t tmp_array[(MAX_PB_SIZE + QPEL_EXTRA) * MAX_PB_SIZE];
|
||||
int16_t *tmp = tmp_array;
|
||||
int shift = 14 + 1 - BIT_DEPTH;
|
||||
#if BIT_DEPTH < 14
|
||||
int offset = 1 << (shift - 1);
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
int offset = (1 << shift) >> 1;
|
||||
|
||||
src -= QPEL_EXTRA_BEFORE * srcstride;
|
||||
filter = ff_hevc_qpel_filters[mx - 1];
|
||||
|
@ -917,11 +896,12 @@ static void FUNC(put_hevc_qpel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8
|
|||
src2 += MAX_PB_SIZE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void FUNC(put_hevc_qpel_uni_w_h)(uint8_t *_dst, ptrdiff_t _dststride,
|
||||
uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, int denom, int wx, int ox,
|
||||
intptr_t mx, intptr_t my, int width)
|
||||
intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel*)_src;
|
||||
|
@ -930,11 +910,7 @@ static void FUNC(put_hevc_qpel_uni_w_h)(uint8_t *_dst, ptrdiff_t _dststride,
|
|||
ptrdiff_t dststride = _dststride / sizeof(pixel);
|
||||
const int8_t *filter = ff_hevc_qpel_filters[mx - 1];
|
||||
int shift = denom + 14 - BIT_DEPTH;
|
||||
#if BIT_DEPTH < 14
|
||||
int offset = 1 << (shift - 1);
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
int offset = (1 << shift) >> 1;
|
||||
|
||||
ox = ox * (1 << (BIT_DEPTH - 8));
|
||||
for (y = 0; y < height; y++) {
|
||||
|
@ -945,10 +921,11 @@ static void FUNC(put_hevc_qpel_uni_w_h)(uint8_t *_dst, ptrdiff_t _dststride,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef USE_BIPRED
|
||||
static void FUNC(put_hevc_qpel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int16_t *src2,
|
||||
int height, int denom, int wx0, int wx1,
|
||||
int ox0, int ox1, intptr_t mx, intptr_t my, int width)
|
||||
int ox0, int ox1, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel*)_src;
|
||||
|
@ -972,11 +949,12 @@ static void FUNC(put_hevc_qpel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, uint
|
|||
src2 += MAX_PB_SIZE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void FUNC(put_hevc_qpel_uni_w_v)(uint8_t *_dst, ptrdiff_t _dststride,
|
||||
uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, int denom, int wx, int ox,
|
||||
intptr_t mx, intptr_t my, int width)
|
||||
intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel*)_src;
|
||||
|
@ -985,11 +963,7 @@ static void FUNC(put_hevc_qpel_uni_w_v)(uint8_t *_dst, ptrdiff_t _dststride,
|
|||
ptrdiff_t dststride = _dststride / sizeof(pixel);
|
||||
const int8_t *filter = ff_hevc_qpel_filters[my - 1];
|
||||
int shift = denom + 14 - BIT_DEPTH;
|
||||
#if BIT_DEPTH < 14
|
||||
int offset = 1 << (shift - 1);
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
int offset = (1 << shift) >> 1;
|
||||
|
||||
ox = ox * (1 << (BIT_DEPTH - 8));
|
||||
for (y = 0; y < height; y++) {
|
||||
|
@ -1000,10 +974,11 @@ static void FUNC(put_hevc_qpel_uni_w_v)(uint8_t *_dst, ptrdiff_t _dststride,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef USE_BIPRED
|
||||
static void FUNC(put_hevc_qpel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int16_t *src2,
|
||||
int height, int denom, int wx0, int wx1,
|
||||
int ox0, int ox1, intptr_t mx, intptr_t my, int width)
|
||||
int ox0, int ox1, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel*)_src;
|
||||
|
@ -1027,11 +1002,12 @@ static void FUNC(put_hevc_qpel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, uint
|
|||
src2 += MAX_PB_SIZE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void FUNC(put_hevc_qpel_uni_w_hv)(uint8_t *_dst, ptrdiff_t _dststride,
|
||||
uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, int denom, int wx, int ox,
|
||||
intptr_t mx, intptr_t my, int width)
|
||||
intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
const int8_t *filter;
|
||||
|
@ -1042,11 +1018,7 @@ static void FUNC(put_hevc_qpel_uni_w_hv)(uint8_t *_dst, ptrdiff_t _dststride,
|
|||
int16_t tmp_array[(MAX_PB_SIZE + QPEL_EXTRA) * MAX_PB_SIZE];
|
||||
int16_t *tmp = tmp_array;
|
||||
int shift = denom + 14 - BIT_DEPTH;
|
||||
#if BIT_DEPTH < 14
|
||||
int offset = 1 << (shift - 1);
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
int offset = (1 << shift) >> 1;
|
||||
|
||||
src -= QPEL_EXTRA_BEFORE * srcstride;
|
||||
filter = ff_hevc_qpel_filters[mx - 1];
|
||||
|
@ -1069,10 +1041,11 @@ static void FUNC(put_hevc_qpel_uni_w_hv)(uint8_t *_dst, ptrdiff_t _dststride,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef USE_BIPRED
|
||||
static void FUNC(put_hevc_qpel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int16_t *src2,
|
||||
int height, int denom, int wx0, int wx1,
|
||||
int ox0, int ox1, intptr_t mx, intptr_t my, int width)
|
||||
int ox0, int ox1, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
const int8_t *filter;
|
||||
|
@ -1108,6 +1081,7 @@ static void FUNC(put_hevc_qpel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, uin
|
|||
src2 += MAX_PB_SIZE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
@ -1118,9 +1092,10 @@ static void FUNC(put_hevc_qpel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, uin
|
|||
filter[2] * src[x + stride] + \
|
||||
filter[3] * src[x + 2 * stride])
|
||||
|
||||
#ifdef USE_BIPRED
|
||||
static void FUNC(put_hevc_epel_h)(int16_t *dst,
|
||||
uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width)
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel *)_src;
|
||||
|
@ -1136,7 +1111,7 @@ static void FUNC(put_hevc_epel_h)(int16_t *dst,
|
|||
|
||||
static void FUNC(put_hevc_epel_v)(int16_t *dst,
|
||||
uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width)
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel *)_src;
|
||||
|
@ -1153,7 +1128,7 @@ static void FUNC(put_hevc_epel_v)(int16_t *dst,
|
|||
|
||||
static void FUNC(put_hevc_epel_hv)(int16_t *dst,
|
||||
uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width)
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel *)_src;
|
||||
|
@ -1181,9 +1156,10 @@ static void FUNC(put_hevc_epel_hv)(int16_t *dst,
|
|||
dst += MAX_PB_SIZE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void FUNC(put_hevc_epel_uni_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width)
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel *)_src;
|
||||
|
@ -1192,11 +1168,7 @@ static void FUNC(put_hevc_epel_uni_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8
|
|||
ptrdiff_t dststride = _dststride / sizeof(pixel);
|
||||
const int8_t *filter = ff_hevc_epel_filters[mx - 1];
|
||||
int shift = 14 - BIT_DEPTH;
|
||||
#if BIT_DEPTH < 14
|
||||
int offset = 1 << (shift - 1);
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
int offset = (1 << shift) >> 1;
|
||||
|
||||
for (y = 0; y < height; y++) {
|
||||
for (x = 0; x < width; x++)
|
||||
|
@ -1206,9 +1178,10 @@ static void FUNC(put_hevc_epel_uni_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef USE_BIPRED
|
||||
static void FUNC(put_hevc_epel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int16_t *src2,
|
||||
int height, intptr_t mx, intptr_t my, int width)
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel *)_src;
|
||||
|
@ -1217,11 +1190,7 @@ static void FUNC(put_hevc_epel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_
|
|||
ptrdiff_t dststride = _dststride / sizeof(pixel);
|
||||
const int8_t *filter = ff_hevc_epel_filters[mx - 1];
|
||||
int shift = 14 + 1 - BIT_DEPTH;
|
||||
#if BIT_DEPTH < 14
|
||||
int offset = 1 << (shift - 1);
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
int offset = (1 << shift) >> 1;
|
||||
|
||||
for (y = 0; y < height; y++) {
|
||||
for (x = 0; x < width; x++) {
|
||||
|
@ -1232,9 +1201,10 @@ static void FUNC(put_hevc_epel_bi_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_
|
|||
src2 += MAX_PB_SIZE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void FUNC(put_hevc_epel_uni_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width)
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel *)_src;
|
||||
|
@ -1243,11 +1213,7 @@ static void FUNC(put_hevc_epel_uni_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8
|
|||
ptrdiff_t dststride = _dststride / sizeof(pixel);
|
||||
const int8_t *filter = ff_hevc_epel_filters[my - 1];
|
||||
int shift = 14 - BIT_DEPTH;
|
||||
#if BIT_DEPTH < 14
|
||||
int offset = 1 << (shift - 1);
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
int offset = (1 << shift) >> 1;
|
||||
|
||||
for (y = 0; y < height; y++) {
|
||||
for (x = 0; x < width; x++)
|
||||
|
@ -1257,9 +1223,10 @@ static void FUNC(put_hevc_epel_uni_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef USE_BIPRED
|
||||
static void FUNC(put_hevc_epel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int16_t *src2,
|
||||
int height, intptr_t mx, intptr_t my, int width)
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel *)_src;
|
||||
|
@ -1268,11 +1235,7 @@ static void FUNC(put_hevc_epel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_
|
|||
pixel *dst = (pixel *)_dst;
|
||||
ptrdiff_t dststride = _dststride / sizeof(pixel);
|
||||
int shift = 14 + 1 - BIT_DEPTH;
|
||||
#if BIT_DEPTH < 14
|
||||
int offset = 1 << (shift - 1);
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
int offset = (1 << shift) >> 1;
|
||||
|
||||
for (y = 0; y < height; y++) {
|
||||
for (x = 0; x < width; x++)
|
||||
|
@ -1282,9 +1245,10 @@ static void FUNC(put_hevc_epel_bi_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_
|
|||
src2 += MAX_PB_SIZE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void FUNC(put_hevc_epel_uni_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width)
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel *)_src;
|
||||
|
@ -1295,11 +1259,7 @@ static void FUNC(put_hevc_epel_uni_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint
|
|||
int16_t tmp_array[(MAX_PB_SIZE + EPEL_EXTRA) * MAX_PB_SIZE];
|
||||
int16_t *tmp = tmp_array;
|
||||
int shift = 14 - BIT_DEPTH;
|
||||
#if BIT_DEPTH < 14
|
||||
int offset = 1 << (shift - 1);
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
int offset = (1 << shift) >> 1;
|
||||
|
||||
src -= EPEL_EXTRA_BEFORE * srcstride;
|
||||
|
||||
|
@ -1321,9 +1281,10 @@ static void FUNC(put_hevc_epel_uni_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef USE_BIPRED
|
||||
static void FUNC(put_hevc_epel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int16_t *src2,
|
||||
int height, intptr_t mx, intptr_t my, int width)
|
||||
int height, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel *)_src;
|
||||
|
@ -1334,11 +1295,7 @@ static void FUNC(put_hevc_epel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8
|
|||
int16_t tmp_array[(MAX_PB_SIZE + EPEL_EXTRA) * MAX_PB_SIZE];
|
||||
int16_t *tmp = tmp_array;
|
||||
int shift = 14 + 1 - BIT_DEPTH;
|
||||
#if BIT_DEPTH < 14
|
||||
int offset = 1 << (shift - 1);
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
int offset = (1 << shift) >> 1;
|
||||
|
||||
src -= EPEL_EXTRA_BEFORE * srcstride;
|
||||
|
||||
|
@ -1360,9 +1317,10 @@ static void FUNC(put_hevc_epel_bi_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8
|
|||
src2 += MAX_PB_SIZE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void FUNC(put_hevc_epel_uni_w_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width)
|
||||
int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel *)_src;
|
||||
|
@ -1371,11 +1329,7 @@ static void FUNC(put_hevc_epel_uni_w_h)(uint8_t *_dst, ptrdiff_t _dststride, uin
|
|||
ptrdiff_t dststride = _dststride / sizeof(pixel);
|
||||
const int8_t *filter = ff_hevc_epel_filters[mx - 1];
|
||||
int shift = denom + 14 - BIT_DEPTH;
|
||||
#if BIT_DEPTH < 14
|
||||
int offset = 1 << (shift - 1);
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
int offset = (1 << shift) >> 1;
|
||||
|
||||
ox = ox * (1 << (BIT_DEPTH - 8));
|
||||
for (y = 0; y < height; y++) {
|
||||
|
@ -1387,10 +1341,11 @@ static void FUNC(put_hevc_epel_uni_w_h)(uint8_t *_dst, ptrdiff_t _dststride, uin
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef USE_BIPRED
|
||||
static void FUNC(put_hevc_epel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int16_t *src2,
|
||||
int height, int denom, int wx0, int wx1,
|
||||
int ox0, int ox1, intptr_t mx, intptr_t my, int width)
|
||||
int ox0, int ox1, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel *)_src;
|
||||
|
@ -1412,9 +1367,10 @@ static void FUNC(put_hevc_epel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride, uint
|
|||
src2 += MAX_PB_SIZE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void FUNC(put_hevc_epel_uni_w_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width)
|
||||
int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel *)_src;
|
||||
|
@ -1423,11 +1379,7 @@ static void FUNC(put_hevc_epel_uni_w_v)(uint8_t *_dst, ptrdiff_t _dststride, uin
|
|||
ptrdiff_t dststride = _dststride / sizeof(pixel);
|
||||
const int8_t *filter = ff_hevc_epel_filters[my - 1];
|
||||
int shift = denom + 14 - BIT_DEPTH;
|
||||
#if BIT_DEPTH < 14
|
||||
int offset = 1 << (shift - 1);
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
int offset = (1 << shift) >> 1;
|
||||
|
||||
ox = ox * (1 << (BIT_DEPTH - 8));
|
||||
for (y = 0; y < height; y++) {
|
||||
|
@ -1439,10 +1391,11 @@ static void FUNC(put_hevc_epel_uni_w_v)(uint8_t *_dst, ptrdiff_t _dststride, uin
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef USE_BIPRED
|
||||
static void FUNC(put_hevc_epel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int16_t *src2,
|
||||
int height, int denom, int wx0, int wx1,
|
||||
int ox0, int ox1, intptr_t mx, intptr_t my, int width)
|
||||
int ox0, int ox1, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel *)_src;
|
||||
|
@ -1464,9 +1417,10 @@ static void FUNC(put_hevc_epel_bi_w_v)(uint8_t *_dst, ptrdiff_t _dststride, uint
|
|||
src2 += MAX_PB_SIZE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void FUNC(put_hevc_epel_uni_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width)
|
||||
int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel *)_src;
|
||||
|
@ -1477,11 +1431,7 @@ static void FUNC(put_hevc_epel_uni_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, ui
|
|||
int16_t tmp_array[(MAX_PB_SIZE + EPEL_EXTRA) * MAX_PB_SIZE];
|
||||
int16_t *tmp = tmp_array;
|
||||
int shift = denom + 14 - BIT_DEPTH;
|
||||
#if BIT_DEPTH < 14
|
||||
int offset = 1 << (shift - 1);
|
||||
#else
|
||||
int offset = 0;
|
||||
#endif
|
||||
int offset = (1 << shift) >> 1;
|
||||
|
||||
src -= EPEL_EXTRA_BEFORE * srcstride;
|
||||
|
||||
|
@ -1504,10 +1454,11 @@ static void FUNC(put_hevc_epel_uni_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, ui
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef USE_BIPRED
|
||||
static void FUNC(put_hevc_epel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int16_t *src2,
|
||||
int height, int denom, int wx0, int wx1,
|
||||
int ox0, int ox1, intptr_t mx, intptr_t my, int width)
|
||||
int ox0, int ox1, intptr_t mx, intptr_t my, int width BIT_DEPTH_PARAM)
|
||||
{
|
||||
int x, y;
|
||||
pixel *src = (pixel *)_src;
|
||||
|
@ -1545,6 +1496,8 @@ static void FUNC(put_hevc_epel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, uin
|
|||
}// line zero
|
||||
#endif
|
||||
|
||||
#endif /* USE_PRED */
|
||||
|
||||
|
||||
#define P3 pix[-4 * xstride]
|
||||
#define P2 pix[-3 * xstride]
|
||||
|
|
76
libavcodec/videodsp.c
Normal file
76
libavcodec/videodsp.c
Normal file
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
* Copyright (C) 2012 Ronald S. Bultje
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/common.h"
|
||||
#include "videodsp.h"
|
||||
|
||||
#ifdef USE_PRED
|
||||
|
||||
#if !defined(USE_VAR_BIT_DEPTH)
|
||||
#define BIT_DEPTH 8
|
||||
#include "videodsp_template.c"
|
||||
#undef BIT_DEPTH
|
||||
#endif
|
||||
|
||||
#if defined(USE_VAR_BIT_DEPTH) || defined(USE_FULL)
|
||||
#define BIT_DEPTH 16
|
||||
#include "videodsp_template.c"
|
||||
#undef BIT_DEPTH
|
||||
#endif
|
||||
|
||||
#ifdef USE_FULL
|
||||
static void just_return(uint8_t *buf, ptrdiff_t stride, int h)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
av_cold void ff_videodsp_init(VideoDSPContext *ctx, int bpc)
|
||||
{
|
||||
#ifdef USE_FULL
|
||||
ctx->prefetch = just_return;
|
||||
#endif
|
||||
|
||||
#ifdef USE_FULL
|
||||
if (bpc <= 8) {
|
||||
ctx->emulated_edge_mc = ff_emulated_edge_mc_8;
|
||||
} else {
|
||||
ctx->emulated_edge_mc = ff_emulated_edge_mc_16;
|
||||
}
|
||||
#else
|
||||
#if defined(USE_VAR_BIT_DEPTH)
|
||||
ctx->emulated_edge_mc = ff_emulated_edge_mc_var;
|
||||
#else
|
||||
ctx->emulated_edge_mc = ff_emulated_edge_mc_8;
|
||||
#endif
|
||||
#endif /* !USE_FULL */
|
||||
|
||||
if (ARCH_AARCH64)
|
||||
ff_videodsp_init_aarch64(ctx, bpc);
|
||||
if (ARCH_ARM)
|
||||
ff_videodsp_init_arm(ctx, bpc);
|
||||
if (ARCH_PPC)
|
||||
ff_videodsp_init_ppc(ctx, bpc);
|
||||
if (ARCH_X86)
|
||||
ff_videodsp_init_x86(ctx, bpc);
|
||||
}
|
||||
|
||||
#endif
|
100
libavcodec/videodsp_template.c
Normal file
100
libavcodec/videodsp_template.c
Normal file
|
@ -0,0 +1,100 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2012 Michael Niedermayer
|
||||
* Copyright (C) 2012 Ronald S. Bultje
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "bit_depth_template.c"
|
||||
void FUNC(ff_emulated_edge_mc)(uint8_t *buf, const uint8_t *src,
|
||||
ptrdiff_t buf_linesize,
|
||||
ptrdiff_t src_linesize,
|
||||
int block_w, int block_h,
|
||||
int src_x, int src_y, int w, int h)
|
||||
{
|
||||
int x, y;
|
||||
int start_y, start_x, end_y, end_x;
|
||||
|
||||
if (!w || !h)
|
||||
return;
|
||||
|
||||
if (src_y >= h) {
|
||||
src -= src_y * src_linesize;
|
||||
src += (h - 1) * src_linesize;
|
||||
src_y = h - 1;
|
||||
} else if (src_y <= -block_h) {
|
||||
src -= src_y * src_linesize;
|
||||
src += (1 - block_h) * src_linesize;
|
||||
src_y = 1 - block_h;
|
||||
}
|
||||
if (src_x >= w) {
|
||||
src += (w - 1 - src_x) * sizeof(pixel);
|
||||
src_x = w - 1;
|
||||
} else if (src_x <= -block_w) {
|
||||
src += (1 - block_w - src_x) * sizeof(pixel);
|
||||
src_x = 1 - block_w;
|
||||
}
|
||||
|
||||
start_y = FFMAX(0, -src_y);
|
||||
start_x = FFMAX(0, -src_x);
|
||||
end_y = FFMIN(block_h, h-src_y);
|
||||
end_x = FFMIN(block_w, w-src_x);
|
||||
av_assert2(start_y < end_y && block_h);
|
||||
av_assert2(start_x < end_x && block_w);
|
||||
|
||||
w = end_x - start_x;
|
||||
src += start_y * src_linesize + start_x * sizeof(pixel);
|
||||
buf += start_x * sizeof(pixel);
|
||||
|
||||
// top
|
||||
for (y = 0; y < start_y; y++) {
|
||||
memcpy(buf, src, w * sizeof(pixel));
|
||||
buf += buf_linesize;
|
||||
}
|
||||
|
||||
// copy existing part
|
||||
for (; y < end_y; y++) {
|
||||
memcpy(buf, src, w * sizeof(pixel));
|
||||
src += src_linesize;
|
||||
buf += buf_linesize;
|
||||
}
|
||||
|
||||
// bottom
|
||||
src -= src_linesize;
|
||||
for (; y < block_h; y++) {
|
||||
memcpy(buf, src, w * sizeof(pixel));
|
||||
buf += buf_linesize;
|
||||
}
|
||||
|
||||
buf -= block_h * buf_linesize + start_x * sizeof(pixel);
|
||||
while (block_h--) {
|
||||
pixel *bufp = (pixel *) buf;
|
||||
|
||||
// left
|
||||
for(x = 0; x < start_x; x++) {
|
||||
bufp[x] = bufp[start_x];
|
||||
}
|
||||
|
||||
// right
|
||||
for (x = end_x; x < block_w; x++) {
|
||||
bufp[x] = bufp[end_x - 1];
|
||||
}
|
||||
buf += buf_linesize;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue