FFmpeg
libavcodec
loongarch
h264_intrapred_init_loongarch.c
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2021 Loongson Technology Corporation Limited
3
* Contributed by Hao Chen <chenhao@loongson.cn>
4
*
5
* This file is part of FFmpeg.
6
*
7
* FFmpeg is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public
9
* License as published by the Free Software Foundation; either
10
* version 2.1 of the License, or (at your option) any later version.
11
*
12
* FFmpeg is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
16
*
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with FFmpeg; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
*/
21
22
#include "
libavutil/loongarch/cpu.h
"
23
#include "
libavcodec/h264pred.h
"
24
#include "
h264_intrapred_loongarch.h
"
25
26
av_cold
void
ff_h264_pred_init_loongarch
(
H264PredContext
*
h
,
int
codec_id
,
27
const
int
bit_depth
,
28
const
int
chroma_format_idc)
29
{
30
int
cpu_flags
=
av_get_cpu_flags
();
31
32
if
(
bit_depth
== 8) {
33
if
(
have_lsx
(
cpu_flags
)) {
34
if
(chroma_format_idc <= 1) {
35
}
36
if
(
codec_id
==
AV_CODEC_ID_VP7
||
codec_id
==
AV_CODEC_ID_VP8
) {
37
}
else
{
38
if
(chroma_format_idc <= 1) {
39
}
40
if
(
codec_id
==
AV_CODEC_ID_SVQ3
) {
41
h
->pred16x16[
PLANE_PRED8x8
] =
ff_h264_pred16x16_plane_svq3_8_lsx
;
42
}
else
if
(
codec_id
==
AV_CODEC_ID_RV40
) {
43
h
->pred16x16[
PLANE_PRED8x8
] =
ff_h264_pred16x16_plane_rv40_8_lsx
;
44
}
else
{
45
h
->pred16x16[
PLANE_PRED8x8
] =
ff_h264_pred16x16_plane_h264_8_lsx
;
46
}
47
}
48
}
49
if
(
have_lasx
(
cpu_flags
)) {
50
if
(chroma_format_idc <= 1) {
51
}
52
if
(
codec_id
==
AV_CODEC_ID_VP7
||
codec_id
==
AV_CODEC_ID_VP8
) {
53
}
else
{
54
if
(chroma_format_idc <= 1) {
55
}
56
if
(
codec_id
==
AV_CODEC_ID_SVQ3
) {
57
h
->pred16x16[
PLANE_PRED8x8
] =
ff_h264_pred16x16_plane_svq3_8_lasx
;
58
}
else
if
(
codec_id
==
AV_CODEC_ID_RV40
) {
59
h
->pred16x16[
PLANE_PRED8x8
] =
ff_h264_pred16x16_plane_rv40_8_lasx
;
60
}
else
{
61
h
->pred16x16[
PLANE_PRED8x8
] =
ff_h264_pred16x16_plane_h264_8_lasx
;
62
}
63
}
64
}
65
}
66
}
ff_h264_pred16x16_plane_svq3_8_lasx
void ff_h264_pred16x16_plane_svq3_8_lasx(uint8_t *src, ptrdiff_t stride)
have_lasx
#define have_lasx(flags)
Definition:
cpu.h:29
av_get_cpu_flags
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition:
cpu.c:103
bit_depth
static void bit_depth(AudioStatsContext *s, const uint64_t *const mask, uint8_t *depth)
Definition:
af_astats.c:245
cpu_flags
static atomic_int cpu_flags
Definition:
cpu.c:52
ff_h264_pred16x16_plane_rv40_8_lasx
void ff_h264_pred16x16_plane_rv40_8_lasx(uint8_t *src, ptrdiff_t stride)
av_cold
#define av_cold
Definition:
attributes.h:90
codec_id
enum AVCodecID codec_id
Definition:
vaapi_decode.c:387
AV_CODEC_ID_SVQ3
@ AV_CODEC_ID_SVQ3
Definition:
codec_id.h:75
have_lsx
#define have_lsx(flags)
Definition:
cpu.h:28
PLANE_PRED8x8
#define PLANE_PRED8x8
Definition:
h264pred.h:71
AV_CODEC_ID_VP7
@ AV_CODEC_ID_VP7
Definition:
codec_id.h:233
AV_CODEC_ID_RV40
@ AV_CODEC_ID_RV40
Definition:
codec_id.h:121
ff_h264_pred16x16_plane_svq3_8_lsx
void ff_h264_pred16x16_plane_svq3_8_lsx(uint8_t *src, ptrdiff_t stride)
h264pred.h
ff_h264_pred16x16_plane_h264_8_lasx
void ff_h264_pred16x16_plane_h264_8_lasx(uint8_t *src, ptrdiff_t stride)
H264PredContext
Context for storing H.264 prediction functions.
Definition:
h264pred.h:94
ff_h264_pred16x16_plane_h264_8_lsx
void ff_h264_pred16x16_plane_h264_8_lsx(uint8_t *src, ptrdiff_t stride)
ff_h264_pred16x16_plane_rv40_8_lsx
void ff_h264_pred16x16_plane_rv40_8_lsx(uint8_t *src, ptrdiff_t stride)
AV_CODEC_ID_VP8
@ AV_CODEC_ID_VP8
Definition:
codec_id.h:192
h
h
Definition:
vp9dsp_template.c:2038
ff_h264_pred_init_loongarch
av_cold void ff_h264_pred_init_loongarch(H264PredContext *h, int codec_id, const int bit_depth, const int chroma_format_idc)
Definition:
h264_intrapred_init_loongarch.c:26
cpu.h
h264_intrapred_loongarch.h
Generated on Thu Sep 26 2024 23:15:02 for FFmpeg by
1.8.17