]> git.sesse.net Git - ffmpeg/blob - libavcodec/hevcdec.h
hevcdec: move SEI message parsing into a separate header
[ffmpeg] / libavcodec / hevcdec.h
1 /*
2  * HEVC video decoder
3  *
4  * Copyright (C) 2012 - 2013 Guillaume Martres
5  *
6  * This file is part of Libav.
7  *
8  * Libav 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  * Libav 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 Libav; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22
23 #ifndef AVCODEC_HEVCDEC_H
24 #define AVCODEC_HEVCDEC_H
25
26 #include <stddef.h>
27 #include <stdint.h>
28
29 #include "libavutil/buffer.h"
30
31 #include "avcodec.h"
32 #include "bswapdsp.h"
33 #include "cabac.h"
34 #include "get_bits.h"
35 #include "h2645_parse.h"
36 #include "hevc.h"
37 #include "hevc_ps.h"
38 #include "hevc_sei.h"
39 #include "hevcdsp.h"
40 #include "internal.h"
41 #include "thread.h"
42 #include "videodsp.h"
43
44 //TODO: check if this is really the maximum
45 #define MAX_TRANSFORM_DEPTH 5
46
47 #define MAX_TB_SIZE 32
48 #define MAX_PB_SIZE 64
49 #define MAX_QP 51
50 #define DEFAULT_INTRA_TC_OFFSET 2
51
52 #define HEVC_CONTEXTS 183
53
54 #define MRG_MAX_NUM_CANDS     5
55
56 #define L0 0
57 #define L1 1
58
59 #define EPEL_EXTRA_BEFORE 1
60 #define EPEL_EXTRA_AFTER  2
61 #define EPEL_EXTRA        3
62
63 #define EDGE_EMU_BUFFER_STRIDE 80
64
65 /**
66  * Value of the luma sample at position (x, y) in the 2D array tab.
67  */
68 #define SAMPLE(tab, x, y) ((tab)[(y) * s->sps->width + (x)])
69 #define SAMPLE_CTB(tab, x, y) ((tab)[(y) * min_cb_width + (x)])
70
71 #define IS_IDR(s) (s->nal_unit_type == HEVC_NAL_IDR_W_RADL || s->nal_unit_type == HEVC_NAL_IDR_N_LP)
72 #define IS_BLA(s) (s->nal_unit_type == HEVC_NAL_BLA_W_RADL || s->nal_unit_type == HEVC_NAL_BLA_W_LP || \
73                    s->nal_unit_type == HEVC_NAL_BLA_N_LP)
74 #define IS_IRAP(s) (s->nal_unit_type >= 16 && s->nal_unit_type <= 23)
75
76 #define FFUDIV(a,b) (((a) > 0 ? (a) : (a) - (b) + 1) / (b))
77 #define FFUMOD(a,b) ((a) - (b) * FFUDIV(a,b))
78
79 enum RPSType {
80     ST_CURR_BEF = 0,
81     ST_CURR_AFT,
82     ST_FOLL,
83     LT_CURR,
84     LT_FOLL,
85     NB_RPS_TYPE,
86 };
87
88 enum SyntaxElement {
89     SAO_MERGE_FLAG = 0,
90     SAO_TYPE_IDX,
91     SAO_EO_CLASS,
92     SAO_BAND_POSITION,
93     SAO_OFFSET_ABS,
94     SAO_OFFSET_SIGN,
95     END_OF_SLICE_FLAG,
96     SPLIT_CODING_UNIT_FLAG,
97     CU_TRANSQUANT_BYPASS_FLAG,
98     SKIP_FLAG,
99     CU_QP_DELTA,
100     PRED_MODE_FLAG,
101     PART_MODE,
102     PCM_FLAG,
103     PREV_INTRA_LUMA_PRED_FLAG,
104     MPM_IDX,
105     REM_INTRA_LUMA_PRED_MODE,
106     INTRA_CHROMA_PRED_MODE,
107     MERGE_FLAG,
108     MERGE_IDX,
109     INTER_PRED_IDC,
110     REF_IDX_L0,
111     REF_IDX_L1,
112     ABS_MVD_GREATER0_FLAG,
113     ABS_MVD_GREATER1_FLAG,
114     ABS_MVD_MINUS2,
115     MVD_SIGN_FLAG,
116     MVP_LX_FLAG,
117     NO_RESIDUAL_DATA_FLAG,
118     SPLIT_TRANSFORM_FLAG,
119     CBF_LUMA,
120     CBF_CB_CR,
121     TRANSFORM_SKIP_FLAG,
122     LAST_SIGNIFICANT_COEFF_X_PREFIX,
123     LAST_SIGNIFICANT_COEFF_Y_PREFIX,
124     LAST_SIGNIFICANT_COEFF_X_SUFFIX,
125     LAST_SIGNIFICANT_COEFF_Y_SUFFIX,
126     SIGNIFICANT_COEFF_GROUP_FLAG,
127     SIGNIFICANT_COEFF_FLAG,
128     COEFF_ABS_LEVEL_GREATER1_FLAG,
129     COEFF_ABS_LEVEL_GREATER2_FLAG,
130     COEFF_ABS_LEVEL_REMAINING,
131     COEFF_SIGN_FLAG,
132 };
133
134 enum PartMode {
135     PART_2Nx2N = 0,
136     PART_2NxN  = 1,
137     PART_Nx2N  = 2,
138     PART_NxN   = 3,
139     PART_2NxnU = 4,
140     PART_2NxnD = 5,
141     PART_nLx2N = 6,
142     PART_nRx2N = 7,
143 };
144
145 enum PredMode {
146     MODE_INTER = 0,
147     MODE_INTRA,
148     MODE_SKIP,
149 };
150
151 enum InterPredIdc {
152     PRED_L0 = 0,
153     PRED_L1,
154     PRED_BI,
155 };
156
157 enum IntraPredMode {
158     INTRA_PLANAR = 0,
159     INTRA_DC,
160     INTRA_ANGULAR_2,
161     INTRA_ANGULAR_3,
162     INTRA_ANGULAR_4,
163     INTRA_ANGULAR_5,
164     INTRA_ANGULAR_6,
165     INTRA_ANGULAR_7,
166     INTRA_ANGULAR_8,
167     INTRA_ANGULAR_9,
168     INTRA_ANGULAR_10,
169     INTRA_ANGULAR_11,
170     INTRA_ANGULAR_12,
171     INTRA_ANGULAR_13,
172     INTRA_ANGULAR_14,
173     INTRA_ANGULAR_15,
174     INTRA_ANGULAR_16,
175     INTRA_ANGULAR_17,
176     INTRA_ANGULAR_18,
177     INTRA_ANGULAR_19,
178     INTRA_ANGULAR_20,
179     INTRA_ANGULAR_21,
180     INTRA_ANGULAR_22,
181     INTRA_ANGULAR_23,
182     INTRA_ANGULAR_24,
183     INTRA_ANGULAR_25,
184     INTRA_ANGULAR_26,
185     INTRA_ANGULAR_27,
186     INTRA_ANGULAR_28,
187     INTRA_ANGULAR_29,
188     INTRA_ANGULAR_30,
189     INTRA_ANGULAR_31,
190     INTRA_ANGULAR_32,
191     INTRA_ANGULAR_33,
192     INTRA_ANGULAR_34,
193 };
194
195 enum SAOType {
196     SAO_NOT_APPLIED = 0,
197     SAO_BAND,
198     SAO_EDGE,
199 };
200
201 enum SAOEOClass {
202     SAO_EO_HORIZ = 0,
203     SAO_EO_VERT,
204     SAO_EO_135D,
205     SAO_EO_45D,
206 };
207
208 enum ScanType {
209     SCAN_DIAG = 0,
210     SCAN_HORIZ,
211     SCAN_VERT,
212 };
213
214 typedef struct LongTermRPS {
215     int     poc[32];
216     uint8_t used[32];
217     uint8_t nb_refs;
218 } LongTermRPS;
219
220 typedef struct RefPicList {
221     struct HEVCFrame *ref[HEVC_MAX_REFS];
222     int list[HEVC_MAX_REFS];
223     int isLongTerm[HEVC_MAX_REFS];
224     int nb_refs;
225 } RefPicList;
226
227 typedef struct RefPicListTab {
228     RefPicList refPicList[2];
229 } RefPicListTab;
230
231 typedef struct SliceHeader {
232     unsigned int pps_id;
233
234     ///< address (in raster order) of the first block in the current slice segment
235     unsigned int   slice_segment_addr;
236     ///< address (in raster order) of the first block in the current slice
237     unsigned int   slice_addr;
238
239     enum HEVCSliceType slice_type;
240
241     int pic_order_cnt_lsb;
242
243     uint8_t first_slice_in_pic_flag;
244     uint8_t dependent_slice_segment_flag;
245     uint8_t pic_output_flag;
246     uint8_t colour_plane_id;
247
248     ///< RPS coded in the slice header itself is stored here
249     int short_term_ref_pic_set_sps_flag;
250     int short_term_ref_pic_set_size;
251     ShortTermRPS slice_rps;
252     const ShortTermRPS *short_term_rps;
253     int long_term_ref_pic_set_size;
254     LongTermRPS long_term_rps;
255     unsigned int list_entry_lx[2][32];
256
257     uint8_t rpl_modification_flag[2];
258     uint8_t no_output_of_prior_pics_flag;
259     uint8_t slice_temporal_mvp_enabled_flag;
260
261     unsigned int nb_refs[2];
262
263     uint8_t slice_sample_adaptive_offset_flag[3];
264     uint8_t mvd_l1_zero_flag;
265
266     uint8_t cabac_init_flag;
267     uint8_t disable_deblocking_filter_flag; ///< slice_header_disable_deblocking_filter_flag
268     uint8_t slice_loop_filter_across_slices_enabled_flag;
269     uint8_t collocated_list;
270
271     unsigned int collocated_ref_idx;
272
273     int slice_qp_delta;
274     int slice_cb_qp_offset;
275     int slice_cr_qp_offset;
276
277     int beta_offset;    ///< beta_offset_div2 * 2
278     int tc_offset;      ///< tc_offset_div2 * 2
279
280     unsigned int max_num_merge_cand; ///< 5 - 5_minus_max_num_merge_cand
281
282     int num_entry_point_offsets;
283
284     int8_t slice_qp;
285
286     uint8_t luma_log2_weight_denom;
287     int16_t chroma_log2_weight_denom;
288
289     int16_t luma_weight_l0[16];
290     int16_t chroma_weight_l0[16][2];
291     int16_t chroma_weight_l1[16][2];
292     int16_t luma_weight_l1[16];
293
294     int16_t luma_offset_l0[16];
295     int16_t chroma_offset_l0[16][2];
296
297     int16_t luma_offset_l1[16];
298     int16_t chroma_offset_l1[16][2];
299
300     int slice_ctb_addr_rs;
301 } SliceHeader;
302
303 typedef struct CodingTree {
304     int depth; ///< ctDepth
305 } CodingTree;
306
307 typedef struct CodingUnit {
308     int x;
309     int y;
310
311     enum PredMode pred_mode;    ///< PredMode
312     enum PartMode part_mode;    ///< PartMode
313
314     // Inferred parameters
315     uint8_t intra_split_flag;   ///< IntraSplitFlag
316     uint8_t max_trafo_depth;    ///< MaxTrafoDepth
317     uint8_t cu_transquant_bypass_flag;
318 } CodingUnit;
319
320 typedef struct Mv {
321     int16_t x;  ///< horizontal component of motion vector
322     int16_t y;  ///< vertical component of motion vector
323 } Mv;
324
325 typedef struct MvField {
326     DECLARE_ALIGNED(4, Mv, mv)[2];
327     int8_t ref_idx[2];
328     int8_t pred_flag[2];
329     uint8_t is_intra;
330 } MvField;
331
332 typedef struct NeighbourAvailable {
333     int cand_bottom_left;
334     int cand_left;
335     int cand_up;
336     int cand_up_left;
337     int cand_up_right;
338     int cand_up_right_sap;
339 } NeighbourAvailable;
340
341 typedef struct PredictionUnit {
342     int mpm_idx;
343     int rem_intra_luma_pred_mode;
344     uint8_t intra_pred_mode[4];
345     Mv mvd;
346     uint8_t merge_flag;
347     uint8_t intra_pred_mode_c;
348 } PredictionUnit;
349
350 typedef struct TransformUnit {
351     int cu_qp_delta;
352
353     // Inferred parameters;
354     int cur_intra_pred_mode;
355     uint8_t is_cu_qp_delta_coded;
356 } TransformUnit;
357
358 typedef struct DBParams {
359     int beta_offset;
360     int tc_offset;
361 } DBParams;
362
363 #define HEVC_FRAME_FLAG_OUTPUT    (1 << 0)
364 #define HEVC_FRAME_FLAG_SHORT_REF (1 << 1)
365 #define HEVC_FRAME_FLAG_LONG_REF  (1 << 2)
366
367 typedef struct HEVCFrame {
368     AVFrame *frame;
369     ThreadFrame tf;
370     MvField *tab_mvf;
371     RefPicList *refPicList;
372     RefPicListTab **rpl_tab;
373     int ctb_count;
374     int poc;
375     struct HEVCFrame *collocated_ref;
376
377     AVBufferRef *tab_mvf_buf;
378     AVBufferRef *rpl_tab_buf;
379     AVBufferRef *rpl_buf;
380
381     AVBufferRef *hwaccel_priv_buf;
382     void *hwaccel_picture_private;
383
384     /**
385      * A sequence counter, so that old frames are output first
386      * after a POC reset
387      */
388     uint16_t sequence;
389
390     /**
391      * A combination of HEVC_FRAME_FLAG_*
392      */
393     uint8_t flags;
394 } HEVCFrame;
395
396 struct HEVCContext;
397
398 typedef struct HEVCPredContext {
399     void (*intra_pred[4])(struct HEVCContext *s, int x0, int y0, int c_idx);
400
401     void (*pred_planar[4])(uint8_t *src, const uint8_t *top,
402                            const uint8_t *left, ptrdiff_t stride);
403     void (*pred_dc)(uint8_t *src, const uint8_t *top, const uint8_t *left,
404                     ptrdiff_t stride, int log2_size, int c_idx);
405     void (*pred_angular[4])(uint8_t *src, const uint8_t *top,
406                             const uint8_t *left, ptrdiff_t stride,
407                             int c_idx, int mode);
408 } HEVCPredContext;
409
410 typedef struct HEVCLocalContext {
411     DECLARE_ALIGNED(16, int16_t, mc_buffer[(MAX_PB_SIZE + 24) * MAX_PB_SIZE]);
412     uint8_t cabac_state[HEVC_CONTEXTS];
413
414     uint8_t first_qp_group;
415
416     GetBitContext gb;
417     CABACContext cc;
418
419     int8_t qp_y;
420     int8_t curr_qp_y;
421
422     TransformUnit tu;
423
424     uint8_t ctb_left_flag;
425     uint8_t ctb_up_flag;
426     uint8_t ctb_up_right_flag;
427     uint8_t ctb_up_left_flag;
428     int     start_of_tiles_x;
429     int     end_of_tiles_x;
430     int     end_of_tiles_y;
431     /* +7 is for subpixel interpolation, *2 for high bit depths */
432     DECLARE_ALIGNED(32, uint8_t, edge_emu_buffer)[(MAX_PB_SIZE + 7) * EDGE_EMU_BUFFER_STRIDE * 2];
433     CodingTree ct;
434     CodingUnit cu;
435     PredictionUnit pu;
436     NeighbourAvailable na;
437
438 #define BOUNDARY_LEFT_SLICE     (1 << 0)
439 #define BOUNDARY_LEFT_TILE      (1 << 1)
440 #define BOUNDARY_UPPER_SLICE    (1 << 2)
441 #define BOUNDARY_UPPER_TILE     (1 << 3)
442     /* properties of the boundary of the current CTB for the purposes
443      * of the deblocking filter */
444     int boundary_flags;
445 } HEVCLocalContext;
446
447 typedef struct HEVCContext {
448     const AVClass *c;  // needed by private avoptions
449     AVCodecContext *avctx;
450
451     HEVCLocalContext HEVClc;
452
453     uint8_t cabac_state[HEVC_CONTEXTS];
454
455     /** 1 if the independent slice segment header was successfully parsed */
456     uint8_t slice_initialized;
457
458     AVFrame *frame;
459     AVFrame *sao_frame;
460     AVFrame *tmp_frame;
461     AVFrame *output_frame;
462
463     HEVCParamSets ps;
464     HEVCSEI sei;
465
466     AVBufferPool *tab_mvf_pool;
467     AVBufferPool *rpl_tab_pool;
468
469     ///< candidate references for the current frame
470     RefPicList rps[5];
471
472     SliceHeader sh;
473     SAOParams *sao;
474     DBParams *deblock;
475     enum HEVCNALUnitType nal_unit_type;
476     int temporal_id;  ///< temporal_id_plus1 - 1
477     HEVCFrame *ref;
478     HEVCFrame DPB[32];
479     int poc;
480     int pocTid0;
481     int slice_idx; ///< number of the slice being currently decoded
482     int eos;       ///< current packet contains an EOS/EOB NAL
483     int max_ra;
484     int bs_width;
485     int bs_height;
486
487     int is_decoded;
488
489     HEVCPredContext hpc;
490     HEVCDSPContext hevcdsp;
491     VideoDSPContext vdsp;
492     BswapDSPContext bdsp;
493     int8_t *qp_y_tab;
494     uint8_t *horizontal_bs;
495     uint8_t *vertical_bs;
496
497     int32_t *tab_slice_address;
498
499     //  CU
500     uint8_t *skip_flag;
501     uint8_t *tab_ct_depth;
502     // PU
503     uint8_t *tab_ipm;
504
505     uint8_t *cbf_luma; // cbf_luma of colocated TU
506     uint8_t *is_pcm;
507
508     // CTB-level flags affecting loop filter operation
509     uint8_t *filter_slice_edges;
510
511     /** used on BE to byteswap the lines for checksumming */
512     uint8_t *checksum_buf;
513     int      checksum_buf_size;
514
515     /**
516      * Sequence counters for decoded and output frames, so that old
517      * frames are output first after a POC reset
518      */
519     uint16_t seq_decode;
520     uint16_t seq_output;
521
522     H2645Packet pkt;
523     // type of the first VCL NAL of the current frame
524     enum HEVCNALUnitType first_nal_type;
525
526     uint8_t context_initialized;
527     uint8_t is_nalff;       ///< this flag is != 0 if bitstream is encapsulated
528                             ///< as a format defined in 14496-15
529     int apply_defdispwin;
530
531     int nal_length_size;    ///< Number of bytes used for nal length (1, 2 or 4)
532     int nuh_layer_id;
533 } HEVCContext;
534
535 /**
536  * Mark all frames in DPB as unused for reference.
537  */
538 void ff_hevc_clear_refs(HEVCContext *s);
539
540 /**
541  * Drop all frames currently in DPB.
542  */
543 void ff_hevc_flush_dpb(HEVCContext *s);
544
545 /**
546  * Compute POC of the current frame and return it.
547  */
548 int ff_hevc_compute_poc(HEVCContext *s, int poc_lsb);
549
550 RefPicList *ff_hevc_get_ref_list(HEVCContext *s, HEVCFrame *frame,
551                                  int x0, int y0);
552
553 /**
554  * Construct the reference picture sets for the current frame.
555  */
556 int ff_hevc_frame_rps(HEVCContext *s);
557
558 /**
559  * Construct the reference picture list(s) for the current slice.
560  */
561 int ff_hevc_slice_rpl(HEVCContext *s);
562
563 void ff_hevc_save_states(HEVCContext *s, int ctb_addr_ts);
564 void ff_hevc_cabac_init(HEVCContext *s, int ctb_addr_ts);
565 int ff_hevc_sao_merge_flag_decode(HEVCContext *s);
566 int ff_hevc_sao_type_idx_decode(HEVCContext *s);
567 int ff_hevc_sao_band_position_decode(HEVCContext *s);
568 int ff_hevc_sao_offset_abs_decode(HEVCContext *s);
569 int ff_hevc_sao_offset_sign_decode(HEVCContext *s);
570 int ff_hevc_sao_eo_class_decode(HEVCContext *s);
571 int ff_hevc_end_of_slice_flag_decode(HEVCContext *s);
572 int ff_hevc_cu_transquant_bypass_flag_decode(HEVCContext *s);
573 int ff_hevc_skip_flag_decode(HEVCContext *s, int x0, int y0,
574                              int x_cb, int y_cb);
575 int ff_hevc_pred_mode_decode(HEVCContext *s);
576 int ff_hevc_split_coding_unit_flag_decode(HEVCContext *s, int ct_depth,
577                                           int x0, int y0);
578 int ff_hevc_part_mode_decode(HEVCContext *s, int log2_cb_size);
579 int ff_hevc_pcm_flag_decode(HEVCContext *s);
580 int ff_hevc_prev_intra_luma_pred_flag_decode(HEVCContext *s);
581 int ff_hevc_mpm_idx_decode(HEVCContext *s);
582 int ff_hevc_rem_intra_luma_pred_mode_decode(HEVCContext *s);
583 int ff_hevc_intra_chroma_pred_mode_decode(HEVCContext *s);
584 int ff_hevc_merge_idx_decode(HEVCContext *s);
585 int ff_hevc_merge_flag_decode(HEVCContext *s);
586 int ff_hevc_inter_pred_idc_decode(HEVCContext *s, int nPbW, int nPbH);
587 int ff_hevc_ref_idx_lx_decode(HEVCContext *s, int num_ref_idx_lx);
588 int ff_hevc_mvp_lx_flag_decode(HEVCContext *s);
589 int ff_hevc_no_residual_syntax_flag_decode(HEVCContext *s);
590 int ff_hevc_abs_mvd_greater0_flag_decode(HEVCContext *s);
591 int ff_hevc_abs_mvd_greater1_flag_decode(HEVCContext *s);
592 int ff_hevc_mvd_decode(HEVCContext *s);
593 int ff_hevc_mvd_sign_flag_decode(HEVCContext *s);
594 int ff_hevc_split_transform_flag_decode(HEVCContext *s, int log2_trafo_size);
595 int ff_hevc_cbf_cb_cr_decode(HEVCContext *s, int trafo_depth);
596 int ff_hevc_cbf_luma_decode(HEVCContext *s, int trafo_depth);
597 int ff_hevc_transform_skip_flag_decode(HEVCContext *s, int c_idx);
598 int ff_hevc_last_significant_coeff_x_prefix_decode(HEVCContext *s, int c_idx,
599                                                    int log2_size);
600 int ff_hevc_last_significant_coeff_y_prefix_decode(HEVCContext *s, int c_idx,
601                                                    int log2_size);
602 int ff_hevc_last_significant_coeff_suffix_decode(HEVCContext *s,
603                                                  int last_significant_coeff_prefix);
604 int ff_hevc_significant_coeff_group_flag_decode(HEVCContext *s, int c_idx,
605                                                 int ctx_cg);
606 int ff_hevc_significant_coeff_flag_decode(HEVCContext *s, int c_idx, int x_c,
607                                           int y_c, int log2_trafo_size,
608                                           int scan_idx, int prev_sig);
609 int ff_hevc_coeff_abs_level_greater1_flag_decode(HEVCContext *s, int c_idx,
610                                                  int ctx_set);
611 int ff_hevc_coeff_abs_level_greater2_flag_decode(HEVCContext *s, int c_idx,
612                                                  int inc);
613 int ff_hevc_coeff_abs_level_remaining(HEVCContext *s, int base_level,
614                                       int rc_rice_param);
615 int ff_hevc_coeff_sign_flag(HEVCContext *s, uint8_t nb);
616
617 /**
618  * Get the number of candidate references for the current frame.
619  */
620 int ff_hevc_frame_nb_refs(HEVCContext *s);
621
622 int ff_hevc_set_new_ref(HEVCContext *s, AVFrame **frame, int poc);
623
624 /**
625  * Find next frame in output order and put a reference to it in frame.
626  * @return 1 if a frame was output, 0 otherwise
627  */
628 int ff_hevc_output_frame(HEVCContext *s, AVFrame *frame, int flush);
629
630 void ff_hevc_unref_frame(HEVCContext *s, HEVCFrame *frame, int flags);
631
632 void ff_hevc_set_neighbour_available(HEVCContext *s, int x0, int y0,
633                                      int nPbW, int nPbH);
634 void ff_hevc_luma_mv_merge_mode(HEVCContext *s, int x0, int y0,
635                                 int nPbW, int nPbH, int log2_cb_size,
636                                 int part_idx, int merge_idx, MvField *mv);
637 void ff_hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0,
638                               int nPbW, int nPbH, int log2_cb_size,
639                               int part_idx, int merge_idx,
640                               MvField *mv, int mvp_lx_flag, int LX);
641 void ff_hevc_set_qPy(HEVCContext *s, int xC, int yC, int xBase, int yBase,
642                      int log2_cb_size);
643 void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0,
644                                            int log2_trafo_size);
645 int ff_hevc_cu_qp_delta_sign_flag(HEVCContext *s);
646 int ff_hevc_cu_qp_delta_abs(HEVCContext *s);
647 void ff_hevc_hls_filter(HEVCContext *s, int x, int y);
648 void ff_hevc_hls_filters(HEVCContext *s, int x_ctb, int y_ctb, int ctb_size);
649
650 void ff_hevc_pred_init(HEVCPredContext *hpc, int bit_depth);
651
652 extern const uint8_t ff_hevc_qpel_extra_before[4];
653 extern const uint8_t ff_hevc_qpel_extra_after[4];
654 extern const uint8_t ff_hevc_qpel_extra[4];
655
656 #endif /* AVCODEC_HEVCDEC_H */