FFmpeg
nvdec_hevc.c
Go to the documentation of this file.
1 /*
2  * HEVC HW decode acceleration through NVDEC
3  *
4  * Copyright (c) 2017 Anton Khirnov
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #include <stdint.h>
24 #include <string.h>
25 
26 #include "libavutil/mem.h"
27 #include "avcodec.h"
28 #include "nvdec.h"
29 #include "decode.h"
30 #include "internal.h"
31 #include "hevcdec.h"
32 #include "hevc_data.h"
33 #include "hwaccel_internal.h"
34 
35 static void dpb_add(CUVIDHEVCPICPARAMS *pp, int idx, const HEVCFrame *src)
36 {
37  FrameDecodeData *fdd = (FrameDecodeData*)src->frame->private_ref->data;
38  const NVDECFrame *cf = fdd->hwaccel_priv;
39 
40  pp->RefPicIdx[idx] = cf ? cf->idx : -1;
41  pp->PicOrderCntVal[idx] = src->poc;
42  pp->IsLongTerm[idx] = !!(src->flags & HEVC_FRAME_FLAG_LONG_REF);
43 }
44 
45 static void fill_scaling_lists(CUVIDHEVCPICPARAMS *ppc, const HEVCContext *s)
46 {
47  const ScalingList *sl = s->ps.pps->scaling_list_data_present_flag ?
48  &s->ps.pps->scaling_list : &s->ps.sps->scaling_list;
49  int i, j, pos;
50 
51  for (i = 0; i < 6; i++) {
52  for (j = 0; j < 16; j++) {
54  ppc->ScalingList4x4[i][j] = sl->sl[0][i][pos];
55  }
56 
57  for (j = 0; j < 64; j++) {
59  ppc->ScalingList8x8[i][j] = sl->sl[1][i][pos];
60  ppc->ScalingList16x16[i][j] = sl->sl[2][i][pos];
61 
62  if (i < 2)
63  ppc->ScalingList32x32[i][j] = sl->sl[3][i * 3][pos];
64  }
65 
66  ppc->ScalingListDCCoeff16x16[i] = sl->sl_dc[0][i];
67  if (i < 2)
68  ppc->ScalingListDCCoeff32x32[i] = sl->sl_dc[1][i * 3];
69  }
70 }
71 
73  const uint8_t *buffer, uint32_t size)
74 {
75  const HEVCContext *s = avctx->priv_data;
76  const HEVCPPS *pps = s->ps.pps;
77  const HEVCSPS *sps = s->ps.sps;
78 
80  CUVIDPICPARAMS *pp = &ctx->pic_params;
81  CUVIDHEVCPICPARAMS *ppc = &pp->CodecSpecific.hevc;
82  FrameDecodeData *fdd;
83  NVDECFrame *cf;
84 
85  int i, j, dpb_size, ret;
86 
87  ret = ff_nvdec_start_frame(avctx, s->ref->frame);
88  if (ret < 0)
89  return ret;
90 
91  fdd = (FrameDecodeData*)s->ref->frame->private_ref->data;
92  cf = (NVDECFrame*)fdd->hwaccel_priv;
93 
94  *pp = (CUVIDPICPARAMS) {
95  .PicWidthInMbs = sps->width / 16,
96  .FrameHeightInMbs = sps->height / 16,
97  .CurrPicIdx = cf->idx,
98  .ref_pic_flag = 1,
99  .intra_pic_flag = IS_IRAP(s),
100 
101  .CodecSpecific.hevc = {
102  .pic_width_in_luma_samples = sps->width,
103  .pic_height_in_luma_samples = sps->height,
104  .log2_min_luma_coding_block_size_minus3 = sps->log2_min_cb_size - 3,
105  .log2_diff_max_min_luma_coding_block_size = sps->log2_diff_max_min_coding_block_size,
106  .log2_min_transform_block_size_minus2 = sps->log2_min_tb_size - 2,
107  .log2_diff_max_min_transform_block_size = sps->log2_max_trafo_size - sps->log2_min_tb_size,
108  .pcm_enabled_flag = sps->pcm_enabled_flag,
109  .log2_min_pcm_luma_coding_block_size_minus3 = sps->pcm_enabled_flag ? sps->pcm.log2_min_pcm_cb_size - 3 : 0,
110  .log2_diff_max_min_pcm_luma_coding_block_size = sps->pcm.log2_max_pcm_cb_size - sps->pcm.log2_min_pcm_cb_size,
111  .pcm_sample_bit_depth_luma_minus1 = sps->pcm_enabled_flag ? sps->pcm.bit_depth - 1 : 0,
112  .pcm_sample_bit_depth_chroma_minus1 = sps->pcm_enabled_flag ? sps->pcm.bit_depth_chroma - 1 : 0,
113 #if NVDECAPI_CHECK_VERSION(8, 1)
114  .log2_max_transform_skip_block_size_minus2 = pps->log2_max_transform_skip_block_size - 2,
115  .log2_sao_offset_scale_luma = pps->log2_sao_offset_scale_luma,
116  .log2_sao_offset_scale_chroma = pps->log2_sao_offset_scale_chroma,
117  .high_precision_offsets_enabled_flag = sps->high_precision_offsets_enabled_flag,
118 #endif
119  .pcm_loop_filter_disabled_flag = sps->pcm.loop_filter_disable_flag,
120  .strong_intra_smoothing_enabled_flag = sps->sps_strong_intra_smoothing_enable_flag,
121  .max_transform_hierarchy_depth_intra = sps->max_transform_hierarchy_depth_intra,
122  .max_transform_hierarchy_depth_inter = sps->max_transform_hierarchy_depth_inter,
123  .amp_enabled_flag = sps->amp_enabled_flag,
124  .separate_colour_plane_flag = sps->separate_colour_plane_flag,
125  .log2_max_pic_order_cnt_lsb_minus4 = sps->log2_max_poc_lsb - 4,
126  .num_short_term_ref_pic_sets = sps->nb_st_rps,
127  .long_term_ref_pics_present_flag = sps->long_term_ref_pics_present_flag,
128  .num_long_term_ref_pics_sps = sps->num_long_term_ref_pics_sps,
129  .sps_temporal_mvp_enabled_flag = sps->sps_temporal_mvp_enabled_flag,
130  .sample_adaptive_offset_enabled_flag = sps->sao_enabled,
131  .scaling_list_enable_flag = sps->scaling_list_enable_flag,
132  .IrapPicFlag = IS_IRAP(s),
133  .IdrPicFlag = IS_IDR(s),
134  .bit_depth_luma_minus8 = sps->bit_depth - 8,
135  .bit_depth_chroma_minus8 = sps->bit_depth - 8,
136 #if NVDECAPI_CHECK_VERSION(9, 0)
137  .sps_range_extension_flag = sps->sps_range_extension_flag,
138  .transform_skip_rotation_enabled_flag = sps->transform_skip_rotation_enabled_flag,
139  .transform_skip_context_enabled_flag = sps->transform_skip_context_enabled_flag,
140  .implicit_rdpcm_enabled_flag = sps->implicit_rdpcm_enabled_flag,
141  .explicit_rdpcm_enabled_flag = sps->explicit_rdpcm_enabled_flag,
142  .extended_precision_processing_flag = sps->extended_precision_processing_flag,
143  .intra_smoothing_disabled_flag = sps->intra_smoothing_disabled_flag,
144  .persistent_rice_adaptation_enabled_flag = sps->persistent_rice_adaptation_enabled_flag,
145  .cabac_bypass_alignment_enabled_flag = sps->cabac_bypass_alignment_enabled_flag,
146 #endif
147 
148  .dependent_slice_segments_enabled_flag = pps->dependent_slice_segments_enabled_flag,
149  .slice_segment_header_extension_present_flag = pps->slice_header_extension_present_flag,
150  .sign_data_hiding_enabled_flag = pps->sign_data_hiding_flag,
151  .cu_qp_delta_enabled_flag = pps->cu_qp_delta_enabled_flag,
152  .diff_cu_qp_delta_depth = pps->diff_cu_qp_delta_depth,
153  .init_qp_minus26 = pps->pic_init_qp_minus26,
154  .pps_cb_qp_offset = pps->cb_qp_offset,
155  .pps_cr_qp_offset = pps->cr_qp_offset,
156  .constrained_intra_pred_flag = pps->constrained_intra_pred_flag,
157  .weighted_pred_flag = pps->weighted_pred_flag,
158  .weighted_bipred_flag = pps->weighted_bipred_flag,
159  .transform_skip_enabled_flag = pps->transform_skip_enabled_flag,
160  .transquant_bypass_enabled_flag = pps->transquant_bypass_enable_flag,
161  .entropy_coding_sync_enabled_flag = pps->entropy_coding_sync_enabled_flag,
162  .log2_parallel_merge_level_minus2 = pps->log2_parallel_merge_level - 2,
163  .num_extra_slice_header_bits = pps->num_extra_slice_header_bits,
164  .loop_filter_across_tiles_enabled_flag = pps->loop_filter_across_tiles_enabled_flag,
165  .loop_filter_across_slices_enabled_flag = pps->seq_loop_filter_across_slices_enabled_flag,
166  .output_flag_present_flag = pps->output_flag_present_flag,
167  .num_ref_idx_l0_default_active_minus1 = pps->num_ref_idx_l0_default_active - 1,
168  .num_ref_idx_l1_default_active_minus1 = pps->num_ref_idx_l1_default_active - 1,
169  .lists_modification_present_flag = pps->lists_modification_present_flag,
170  .cabac_init_present_flag = pps->cabac_init_present_flag,
171  .pps_slice_chroma_qp_offsets_present_flag = pps->pic_slice_level_chroma_qp_offsets_present_flag,
172  .deblocking_filter_override_enabled_flag = pps->deblocking_filter_override_enabled_flag,
173  .pps_deblocking_filter_disabled_flag = pps->disable_dbf,
174  .pps_beta_offset_div2 = pps->beta_offset / 2,
175  .pps_tc_offset_div2 = pps->tc_offset / 2,
176  .tiles_enabled_flag = pps->tiles_enabled_flag,
177  .uniform_spacing_flag = pps->uniform_spacing_flag,
178  .num_tile_columns_minus1 = pps->num_tile_columns - 1,
179  .num_tile_rows_minus1 = pps->num_tile_rows - 1,
180 #if NVDECAPI_CHECK_VERSION(9, 0)
181  .pps_range_extension_flag = pps->pps_range_extensions_flag,
182  .cross_component_prediction_enabled_flag = pps->cross_component_prediction_enabled_flag,
183  .chroma_qp_offset_list_enabled_flag = pps->chroma_qp_offset_list_enabled_flag,
184  .diff_cu_chroma_qp_offset_depth = pps->diff_cu_chroma_qp_offset_depth,
185  .chroma_qp_offset_list_len_minus1 = pps->chroma_qp_offset_list_len_minus1,
186 #endif
187 
188  .NumBitsForShortTermRPSInSlice = s->sh.short_term_rps ? s->sh.short_term_ref_pic_set_size : 0,
189  .NumDeltaPocsOfRefRpsIdx = s->sh.short_term_rps ? s->sh.short_term_rps->rps_idx_num_delta_pocs : 0,
190  .NumPocTotalCurr = ff_hevc_frame_nb_refs(s),
191  .NumPocStCurrBefore = s->rps[ST_CURR_BEF].nb_refs,
192  .NumPocStCurrAfter = s->rps[ST_CURR_AFT].nb_refs,
193  .NumPocLtCurr = s->rps[LT_CURR].nb_refs,
194  .CurrPicOrderCntVal = s->ref->poc,
195  },
196  };
197 
198  if (pps->num_tile_columns > FF_ARRAY_ELEMS(ppc->column_width_minus1) ||
199  pps->num_tile_rows > FF_ARRAY_ELEMS(ppc->row_height_minus1)) {
200  av_log(avctx, AV_LOG_ERROR, "Too many tiles\n");
201  return AVERROR(ENOSYS);
202  }
203  for (i = 0; i < pps->num_tile_columns; i++)
204  ppc->column_width_minus1[i] = pps->column_width[i] - 1;
205  for (i = 0; i < pps->num_tile_rows; i++)
206  ppc->row_height_minus1[i] = pps->row_height[i] - 1;
207 
208 #if NVDECAPI_CHECK_VERSION(9, 0)
209  if (pps->chroma_qp_offset_list_len_minus1 >= FF_ARRAY_ELEMS(ppc->cb_qp_offset_list) ||
210  pps->chroma_qp_offset_list_len_minus1 >= FF_ARRAY_ELEMS(ppc->cr_qp_offset_list)) {
211  av_log(avctx, AV_LOG_ERROR, "Too many chroma_qp_offsets\n");
212  return AVERROR(ENOSYS);
213  }
214  for (i = 0; i <= pps->chroma_qp_offset_list_len_minus1; i++) {
215  ppc->cb_qp_offset_list[i] = pps->cb_qp_offset_list[i];
216  ppc->cr_qp_offset_list[i] = pps->cr_qp_offset_list[i];
217  }
218 #endif
219 
220  if (s->rps[LT_CURR].nb_refs > FF_ARRAY_ELEMS(ppc->RefPicSetLtCurr) ||
221  s->rps[ST_CURR_BEF].nb_refs > FF_ARRAY_ELEMS(ppc->RefPicSetStCurrBefore) ||
222  s->rps[ST_CURR_AFT].nb_refs > FF_ARRAY_ELEMS(ppc->RefPicSetStCurrAfter)) {
223  av_log(avctx, AV_LOG_ERROR, "Too many reference frames\n");
224  return AVERROR(ENOSYS);
225  }
226 
227  dpb_size = 0;
228  for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
229  const HEVCFrame *ref = &s->DPB[i];
231  continue;
232  if (dpb_size >= FF_ARRAY_ELEMS(ppc->RefPicIdx)) {
233  av_log(avctx, AV_LOG_ERROR, "Too many reference frames\n");
234  return AVERROR_INVALIDDATA;
235  }
236  dpb_add(ppc, dpb_size++, ref);
237 
238  }
239  for (i = dpb_size; i < FF_ARRAY_ELEMS(ppc->RefPicIdx); i++)
240  ppc->RefPicIdx[i] = -1;
241 
242  for (i = 0; i < s->rps[ST_CURR_BEF].nb_refs; i++) {
243  for (j = 0; j < dpb_size; j++) {
244  if (ppc->PicOrderCntVal[j] == s->rps[ST_CURR_BEF].list[i]) {
245  ppc->RefPicSetStCurrBefore[i] = j;
246  break;
247  }
248  }
249  }
250  for (i = 0; i < s->rps[ST_CURR_AFT].nb_refs; i++) {
251  for (j = 0; j < dpb_size; j++) {
252  if (ppc->PicOrderCntVal[j] == s->rps[ST_CURR_AFT].list[i]) {
253  ppc->RefPicSetStCurrAfter[i] = j;
254  break;
255  }
256  }
257  }
258  for (i = 0; i < s->rps[LT_CURR].nb_refs; i++) {
259  for (j = 0; j < dpb_size; j++) {
260  if (ppc->PicOrderCntVal[j] == s->rps[LT_CURR].list[i]) {
261  ppc->RefPicSetLtCurr[i] = j;
262  break;
263  }
264  }
265  }
266 
267  fill_scaling_lists(ppc, s);
268 
269  return 0;
270 }
271 
272 static int nvdec_hevc_decode_slice(AVCodecContext *avctx, const uint8_t *buffer,
273  uint32_t size)
274 {
276  void *tmp;
277 
278  tmp = av_fast_realloc(ctx->bitstream_internal, &ctx->bitstream_allocated,
279  ctx->bitstream_len + size + 3);
280  if (!tmp)
281  return AVERROR(ENOMEM);
282  ctx->bitstream = ctx->bitstream_internal = tmp;
283 
284  tmp = av_fast_realloc(ctx->slice_offsets, &ctx->slice_offsets_allocated,
285  (ctx->nb_slices + 1) * sizeof(*ctx->slice_offsets));
286  if (!tmp)
287  return AVERROR(ENOMEM);
288  ctx->slice_offsets = tmp;
289 
290  AV_WB24(ctx->bitstream_internal + ctx->bitstream_len, 1);
291  memcpy(ctx->bitstream_internal + ctx->bitstream_len + 3, buffer, size);
292  ctx->slice_offsets[ctx->nb_slices] = ctx->bitstream_len ;
293  ctx->bitstream_len += size + 3;
294  ctx->nb_slices++;
295 
296  return 0;
297 }
298 
300  AVBufferRef *hw_frames_ctx)
301 {
302  const HEVCContext *s = avctx->priv_data;
303  const HEVCSPS *sps = s->ps.sps;
304  return ff_nvdec_frame_params(avctx, hw_frames_ctx, sps->temporal_layer[sps->max_sub_layers - 1].max_dec_pic_buffering + 1, 1);
305 }
306 
309  ctx->supports_444 = 1;
310 
311  if (avctx->profile != AV_PROFILE_HEVC_MAIN &&
312  avctx->profile != AV_PROFILE_HEVC_MAIN_10 &&
314  avctx->profile != AV_PROFILE_HEVC_REXT) {
315  av_log(avctx, AV_LOG_ERROR, "Unsupported HEVC profile: %d\n", avctx->profile);
316  return AVERROR(ENOTSUP);
317  }
318 
319  return ff_nvdec_decode_init(avctx);
320 }
321 
323  .p.name = "hevc_nvdec",
324  .p.type = AVMEDIA_TYPE_VIDEO,
325  .p.id = AV_CODEC_ID_HEVC,
326  .p.pix_fmt = AV_PIX_FMT_CUDA,
327  .start_frame = nvdec_hevc_start_frame,
328  .end_frame = ff_nvdec_end_frame,
329  .decode_slice = nvdec_hevc_decode_slice,
330  .frame_params = nvdec_hevc_frame_params,
331  .init = nvdec_hevc_decode_init,
332  .uninit = ff_nvdec_decode_uninit,
333  .priv_data_size = sizeof(NVDECContext),
334 };
AV_PIX_FMT_CUDA
@ AV_PIX_FMT_CUDA
HW acceleration through CUDA.
Definition: pixfmt.h:260
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
ff_hevc_diag_scan8x8_y
const uint8_t ff_hevc_diag_scan8x8_y[64]
Definition: hevc_data.c:58
AV_PROFILE_HEVC_MAIN
#define AV_PROFILE_HEVC_MAIN
Definition: defs.h:158
FFHWAccel::p
AVHWAccel p
The public AVHWAccel.
Definition: hwaccel_internal.h:38
FrameDecodeData
This struct stores per-frame lavc-internal data and is attached to it via private_ref.
Definition: decode.h:33
tmp
static uint8_t tmp[11]
Definition: aes_ctr.c:28
internal.h
ScalingList::sl
uint8_t sl[4][6][64]
Definition: hevc_ps.h:184
HEVC_FRAME_FLAG_LONG_REF
#define HEVC_FRAME_FLAG_LONG_REF
Definition: hevcdec.h:348
FFHWAccel
Definition: hwaccel_internal.h:34
nvdec_hevc_frame_params
static int nvdec_hevc_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
Definition: nvdec_hevc.c:299
ff_nvdec_start_frame
int ff_nvdec_start_frame(AVCodecContext *avctx, AVFrame *frame)
Definition: nvdec.c:561
NVDECAPI_CHECK_VERSION
#define NVDECAPI_CHECK_VERSION(major, minor)
Definition: nvdec.h:40
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
nvdec_hevc_decode_init
static int nvdec_hevc_decode_init(AVCodecContext *avctx)
Definition: nvdec_hevc.c:307
av_fast_realloc
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given buffer if it is not large enough, otherwise do nothing.
Definition: mem.c:497
s
#define s(width, name)
Definition: cbs_vp9.c:198
ff_hevc_diag_scan8x8_x
const uint8_t ff_hevc_diag_scan8x8_x[64]
Definition: hevc_data.c:39
NVDECFrame
Definition: nvdec.h:44
ctx
AVFormatContext * ctx
Definition: movenc.c:49
decode.h
IS_IDR
#define IS_IDR(s)
Definition: hevcdec.h:75
HEVC_FRAME_FLAG_SHORT_REF
#define HEVC_FRAME_FLAG_SHORT_REF
Definition: hevcdec.h:347
nvdec_hevc_decode_slice
static int nvdec_hevc_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
Definition: nvdec_hevc.c:272
ScalingList
Definition: hevc_ps.h:181
dpb_size
int dpb_size
Definition: h264_levels.c:111
ff_hevc_diag_scan4x4_y
const uint8_t ff_hevc_diag_scan4x4_y[16]
Definition: hevc_data.c:32
ScalingList::sl_dc
uint8_t sl_dc[2][6]
Definition: hevc_ps.h:185
hwaccel_internal.h
ff_nvdec_decode_init
int ff_nvdec_decode_init(AVCodecContext *avctx)
Definition: nvdec.c:327
AVCodecContext::internal
struct AVCodecInternal * internal
Private context used for internal data.
Definition: avcodec.h:480
AV_PROFILE_HEVC_MAIN_STILL_PICTURE
#define AV_PROFILE_HEVC_MAIN_STILL_PICTURE
Definition: defs.h:160
fill_scaling_lists
static void fill_scaling_lists(CUVIDHEVCPICPARAMS *ppc, const HEVCContext *s)
Definition: nvdec_hevc.c:45
AV_PROFILE_HEVC_MAIN_10
#define AV_PROFILE_HEVC_MAIN_10
Definition: defs.h:159
AV_PROFILE_HEVC_REXT
#define AV_PROFILE_HEVC_REXT
Definition: defs.h:161
hevc_data.h
IS_IRAP
#define IS_IRAP(s)
Definition: hevcdec.h:78
pps
static int FUNC() pps(CodedBitstreamContext *ctx, RWContext *rw, H264RawPPS *current)
Definition: cbs_h264_syntax_template.c:404
hevcdec.h
AVCodecInternal::hwaccel_priv_data
void * hwaccel_priv_data
hwaccel-specific private data
Definition: internal.h:121
for
for(k=2;k<=8;++k)
Definition: h264pred_template.c:425
NVDECFrame::idx
unsigned int idx
Definition: nvdec.h:45
size
int size
Definition: twinvq_data.h:10344
AV_WB24
#define AV_WB24(p, d)
Definition: intreadwrite.h:448
dpb_add
static void dpb_add(CUVIDHEVCPICPARAMS *pp, int idx, const HEVCFrame *src)
Definition: nvdec_hevc.c:35
nvdec.h
ff_nvdec_decode_uninit
int ff_nvdec_decode_uninit(AVCodecContext *avctx)
Definition: nvdec.c:259
nvdec_hevc_start_frame
static int nvdec_hevc_start_frame(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
Definition: nvdec_hevc.c:72
AVHWAccel::name
const char * name
Name of the hardware accelerated codec.
Definition: avcodec.h:2094
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
HEVCFrame
Definition: hevcdec.h:354
ff_nvdec_end_frame
int ff_nvdec_end_frame(AVCodecContext *avctx)
Definition: nvdec.c:633
AV_CODEC_ID_HEVC
@ AV_CODEC_ID_HEVC
Definition: codec_id.h:226
ff_hevc_nvdec_hwaccel
const FFHWAccel ff_hevc_nvdec_hwaccel
Definition: nvdec_hevc.c:322
avcodec.h
ret
ret
Definition: filter_design.txt:187
ST_CURR_BEF
@ ST_CURR_BEF
Definition: hevcdec.h:81
sps
static int FUNC() sps(CodedBitstreamContext *ctx, RWContext *rw, H264RawSPS *current)
Definition: cbs_h264_syntax_template.c:260
pos
unsigned int pos
Definition: spdifenc.c:414
ff_hevc_frame_nb_refs
int ff_hevc_frame_nb_refs(const HEVCContext *s)
Get the number of candidate references for the current frame.
Definition: hevc_refs.c:534
LT_CURR
@ LT_CURR
Definition: hevcdec.h:84
AVCodecContext
main external API structure.
Definition: avcodec.h:445
buffer
the frame and frame reference mechanism is intended to as much as expensive copies of that data while still allowing the filters to produce correct results The data is stored in buffers represented by AVFrame structures Several references can point to the same frame buffer
Definition: filter_design.txt:49
HEVCContext
Definition: hevcdec.h:440
ff_nvdec_frame_params
int ff_nvdec_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx, int dpb_size, int supports_444)
Definition: nvdec.c:695
AVCodecContext::profile
int profile
profile
Definition: avcodec.h:1639
ref
static int ref[MAX_W *MAX_W]
Definition: jpeg2000dwt.c:112
ff_hevc_diag_scan4x4_x
const uint8_t ff_hevc_diag_scan4x4_x[16]
Definition: hevc_data.c:25
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
mem.h
AVBufferRef
A reference to a data buffer.
Definition: buffer.h:82
HEVCSPS
Definition: hevc_ps.h:188
HEVCPPS
Definition: hevc_ps.h:305
ST_CURR_AFT
@ ST_CURR_AFT
Definition: hevcdec.h:82
AVCodecContext::priv_data
void * priv_data
Definition: avcodec.h:472
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
FrameDecodeData::hwaccel_priv
void * hwaccel_priv
Per-frame private data for hwaccels.
Definition: decode.h:51
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
NVDECContext
Definition: nvdec.h:52