digiKam
motion.h
Go to the documentation of this file.
1 /*
2  * H.265 video codec.
3  * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de>
4  *
5  * This file is part of libde265.
6  *
7  * libde265 is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License as
9  * published by the Free Software Foundation, either version 3 of
10  * the License, or (at your option) any later version.
11  *
12  * libde265 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
15  * GNU Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with libde265. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef DE265_MOTION_H
22 #define DE265_MOTION_H
23 
24 #include <stdint.h>
25 #include "slice.h"
26 
27 class base_context;
29 
31 {
32  public:
33  int16_t x,y;
34 };
35 
36 
37 class PBMotion
38 {
39  public:
40  uint8_t predFlag[2]; // which of the two vectors is actually used
41  int8_t refIdx[2]; // index into RefPicList
42  MotionVector mv[2]; // the absolute motion vectors
43 
44  bool operator==(const PBMotion&) const;
45 };
46 
47 
49 {
50  public:
51  // index into RefPicList
52  int8_t refIdx[2];
53 
54  // motion vector difference
55  int16_t mvd[2][2]; // [L0/L1][x/y] (only in top left position - ???)
56 
57  // enum InterPredIdc, whether this is prediction from L0,L1, or BI
58  uint8_t inter_pred_idc : 2;
59 
60  // which of the two MVPs is used
61  uint8_t mvp_l0_flag : 1;
62  uint8_t mvp_l1_flag : 1;
63 
64  // whether merge mode is used
65  uint8_t merge_flag : 1;
66  uint8_t merge_idx : 3;
67 };
68 
69 
71  const slice_segment_header* shdr,
72  struct de265_image* img,
73  int xC,int yC, int xP,int yP,
74  int nCS, int nPbW,int nPbH, int partIdx,
75  PBMotion* mergeCandList);
76 
77 /*
78 int derive_spatial_merging_candidates(const struct de265_image* img,
79  int xC, int yC, int nCS, int xP, int yP,
80  uint8_t singleMCLFlag,
81  int nPbW, int nPbH,
82  int partIdx,
83  MotionVectorSpec* out_cand,
84  int maxCandidates);
85 */
86 
88  const slice_segment_header* shdr,
89  struct de265_image* img,
90  int xC,int yC,
91  int xB,int yB,
92  int nCS, int nPbW,int nPbH,
93  const PBMotion* vi);
94 
95 
96 /* Fill list (two entries) of motion-vector predictors for MVD coding.
97  */
99  const slice_segment_header* shdr,
100  de265_image* img,
101  int xC,int yC,int nCS,int xP,int yP,
102  int nPbW,int nPbH, int l,
103  int refIdx, int partIdx,
104  MotionVector out_mvpList[2]);
105 
106 
108  de265_image* img, const PBMotionCoding& motion,
109  int xC,int yC, int xB,int yB, int nCS, int nPbW,int nPbH, int partIdx);
110 
111 
112 
113 
115 {
116 public:
117  virtual enum PartMode get_PartMode(int x,int y) const = 0;
118  virtual const PBMotion& get_mv_info(int x,int y) const = 0;
119 };
120 
121 
123  const slice_segment_header* shdr,
124  const MotionVectorAccess& mvaccess,
125  de265_image* img,
126  int xC,int yC, int xP,int yP,
127  int nCS, int nPbW,int nPbH, int partIdx,
128  int max_merge_idx,
129  PBMotion* mergeCandList);
130 
131 #endif
Definition: motion.h:115
virtual enum PartMode get_PartMode(int x, int y) const =0
virtual const PBMotion & get_mv_info(int x, int y) const =0
Definition: motion.h:31
int16_t x
Definition: motion.h:33
int16_t y
Definition: motion.h:33
Definition: motion.h:49
uint8_t inter_pred_idc
Definition: motion.h:58
uint8_t merge_idx
Definition: motion.h:66
int16_t mvd[2][2]
Definition: motion.h:55
uint8_t mvp_l1_flag
Definition: motion.h:62
uint8_t mvp_l0_flag
Definition: motion.h:61
int8_t refIdx[2]
Definition: motion.h:52
uint8_t merge_flag
Definition: motion.h:65
Definition: motion.h:38
MotionVector mv[2]
Definition: motion.h:42
bool operator==(const PBMotion &) const
uint8_t predFlag[2]
Definition: motion.h:40
int8_t refIdx[2]
Definition: motion.h:41
Definition: decctx.h:274
Definition: slice.h:130
void get_merge_candidate_list_without_step_9(base_context *ctx, const slice_segment_header *shdr, const MotionVectorAccess &mvaccess, de265_image *img, int xC, int yC, int xP, int yP, int nCS, int nPbW, int nPbH, int partIdx, int max_merge_idx, PBMotion *mergeCandList)
void decode_prediction_unit(base_context *ctx, const slice_segment_header *shdr, de265_image *img, const PBMotionCoding &motion, int xC, int yC, int xB, int yB, int nCS, int nPbW, int nPbH, int partIdx)
void generate_inter_prediction_samples(base_context *ctx, const slice_segment_header *shdr, struct de265_image *img, int xC, int yC, int xB, int yB, int nCS, int nPbW, int nPbH, const PBMotion *vi)
void get_merge_candidate_list(base_context *ctx, const slice_segment_header *shdr, struct de265_image *img, int xC, int yC, int xP, int yP, int nCS, int nPbW, int nPbH, int partIdx, PBMotion *mergeCandList)
void fill_luma_motion_vector_predictors(base_context *ctx, const slice_segment_header *shdr, de265_image *img, int xC, int yC, int nCS, int xP, int yP, int nPbW, int nPbH, int l, int refIdx, int partIdx, MotionVector out_mvpList[2])
PartMode
Definition: slice.h:75
Definition: image.h:222