46 template <
class pixel_t> pixel_t*
get_buffer()
const {
return (pixel_t*)mBuf; }
49 assert(b.mHeight==mHeight);
50 assert(b.mBytesPerRow==mBytesPerRow);
51 memcpy(b.mBuf, mBuf, mBytesPerRow*mHeight);
62 uint16_t mBytesPerRow;
64 uint8_t mWidth, mHeight;
104 mBase -= x0 + y0*mStride;
107 const uint8_t*
operator[](
int y)
const {
return mBase+y*mStride; }
125 uint8_t mWidth, mHeight;
129 mStride = mXMin = mYMin = mWidth = mHeight = 0;
322 static void*
operator new(
const size_t size) {
323 void* p = mMemPool.
new_obj(size);
327 static void operator delete(
void* obj) {
346 void alloc(
int w,
int h,
int log2CtbSize);
350 int idx = xCTB + yCTB*mWidthCtbs;
351 assert(idx < mCTBs.size());
352 if (mCTBs[idx]) {
delete mCTBs[idx]; }
357 int idx = xCTB + yCTB*mWidthCtbs;
358 assert(idx < mCTBs.size());
366 int idx = x + y*mWidthCtbs;
367 assert(idx < mCTBs.size());
379 std::vector<enc_cb*> mCTBs;
385 for (
int i=0 ; i<mWidthCtbs*mHeightCtbs ; i++) {
397 inline int childX(
int x0,
int idx,
int log2CbSize)
399 return x0 + ((idx&1) << (log2CbSize-1));
402 inline int childY(
int y0,
int idx,
int log2CbSize)
404 return y0 + ((idx>>1) << (log2CbSize-1));
Definition: encoder-types.h:341
void alloc(int w, int h, int log2CtbSize)
const enc_cb * getCB(int x, int y) const
void writeReconstructionToImage(de265_image *img, const seq_parameter_set *) const
const enc_tb * getTB(int x, int y) const
CTBTreeMatrix()
Definition: encoder-types.h:343
const enc_pb_inter * getPB(int x, int y) const
~CTBTreeMatrix()
Definition: encoder-types.h:344
void clear()
Definition: encoder-types.h:347
const enc_cb * getCTB(int xCTB, int yCTB) const
Definition: encoder-types.h:356
void setCTB(int xCTB, int yCTB, enc_cb *ctb)
Definition: encoder-types.h:349
enc_cb ** getCTBRootPointer(int x, int y)
Definition: encoder-types.h:362
Definition: encoder-types.h:94
PixelAccessor(small_image_buffer &buf, int x0, int y0)
Definition: encoder-types.h:96
void copyToImage(de265_image *img, int cIdx) const
int getWidth() const
Definition: encoder-types.h:110
int getHeight() const
Definition: encoder-types.h:112
void copyFromImage(const de265_image *img, int cIdx)
static PixelAccessor invalid()
Definition: encoder-types.h:117
int getTop() const
Definition: encoder-types.h:111
const uint8_t * operator[](int y) const
Definition: encoder-types.h:107
int getLeft() const
Definition: encoder-types.h:109
Definition: alloc_pool.h:41
void * new_obj(const size_t size)
Definition: encoder-types.h:248
float distortion
Definition: encoder-types.h:293
enum PartMode PartMode
Definition: encoder-types.h:273
uint8_t rqt_root_cbf
Definition: encoder-types.h:284
uint8_t ctDepth
Definition: encoder-types.h:257
enc_pb_inter pb[4]
Definition: encoder-types.h:282
enc_cb * children[4]
Definition: encoder-types.h:263
enum PredMode PredMode
Definition: encoder-types.h:272
enc_cb * parent
Definition: encoder-types.h:253
float rate
Definition: encoder-types.h:294
void writeReconstructionToImage(de265_image *img, const seq_parameter_set *sps) const
uint8_t qp
Definition: encoder-types.h:268
virtual void debug_dumpTree(int flags, int indent=0) const
void set_rqt_root_bf_from_children_cbf()
enc_cb ** downPtr
Definition: encoder-types.h:254
enc_tb * transform_tree
Definition: encoder-types.h:288
uint8_t pcm_flag
Definition: encoder-types.h:270
const enc_tb * getTB(int x, int y) const
uint8_t split_cu_flag
Definition: encoder-types.h:256
uint8_t cu_transquant_bypass_flag
Definition: encoder-types.h:269
void reconstruct(encoder_context *ectx, de265_image *img) const
struct enc_cb::@34::@38::@40::@43 inter
struct enc_cb::@34::@38::@40::@42 intra
Definition: encoder-types.h:74
static const int DUMPTREE_RECONSTRUCTION
Definition: encoder-types.h:86
virtual ~enc_node()
Definition: encoder-types.h:78
static const int DUMPTREE_RESIDUAL
Definition: encoder-types.h:85
enc_node()
Definition: encoder-types.h:76
uint16_t x
Definition: encoder-types.h:80
uint16_t y
Definition: encoder-types.h:80
virtual void debug_dumpTree(int flags, int indent=0) const =0
static const int DUMPTREE_ALL
Definition: encoder-types.h:87
uint8_t log2Size
Definition: encoder-types.h:81
enc_node(int _x, int _y, int _log2Size)
Definition: encoder-types.h:77
static const int DUMPTREE_INTRA_PREDICTION
Definition: encoder-types.h:84
Definition: encoder-types.h:135
uint8_t TrafoDepth
Definition: encoder-types.h:145
PixelAccessor getPixels(int x, int y, int cIdx, const seq_parameter_set &sps)
std::shared_ptr< small_image_buffer > intra_prediction[3]
Definition: encoder-types.h:161
enc_tb(int x, int y, int log2TbSize, enc_cb *_cb)
void reconstruct(encoder_context *ectx, de265_image *img) const
void debug_writeBlack(encoder_context *ectx, de265_image *img) const
void writeReconstructionToImage(de265_image *img, const seq_parameter_set *sps) const
uint8_t blkIdx
Definition: encoder-types.h:146
uint8_t split_transform_flag
Definition: encoder-types.h:144
std::shared_ptr< small_image_buffer > reconstruction[3]
Definition: encoder-types.h:166
enum IntraPredMode intra_mode
Definition: encoder-types.h:148
const enc_tb * getTB(int x, int y) const
std::shared_ptr< small_image_buffer > residual[3]
Definition: encoder-types.h:162
enc_tb ** downPtr
Definition: encoder-types.h:142
bool skip_transform[3][2]
Definition: encoder-types.h:178
float rate
Definition: encoder-types.h:184
enum IntraPredMode intra_mode_chroma
Definition: encoder-types.h:152
enc_cb * cb
Definition: encoder-types.h:141
enc_tb * parent
Definition: encoder-types.h:140
uint8_t explicit_rdpcm[3][2]
Definition: encoder-types.h:179
float rate_withoutCbfChroma
Definition: encoder-types.h:185
int16_t * coeff[3]
Definition: encoder-types.h:176
void set_cbf_flags_from_children()
void alloc_coeff_memory(int cIdx, int tbSize)
enc_tb * children[4]
Definition: encoder-types.h:171
float distortion
Definition: encoder-types.h:183
virtual void debug_dumpTree(int flags, int indent=0) const
uint8_t cbf[3]
Definition: encoder-types.h:154
bool isZeroBlock() const
Definition: encoder-types.h:192
Definition: encoder-context.h:39
Definition: encoder-types.h:38
void copy_to(small_image_buffer &b) const
Definition: encoder-types.h:48
pixel_t * get_buffer() const
Definition: encoder-types.h:46
uint8_t * get_buffer_u8() const
Definition: encoder-types.h:43
int getHeight() const
Definition: encoder-types.h:55
int16_t * get_buffer_s16() const
Definition: encoder-types.h:44
int getStride() const
Definition: encoder-types.h:57
small_image_buffer(int log2Size, int bytes_per_pixel=1)
int getWidth() const
Definition: encoder-types.h:54
uint16_t * get_buffer_u16() const
Definition: encoder-types.h:45
int childY(int y0, int idx, int log2CbSize)
Definition: encoder-types.h:402
int childX(int x0, int idx, int log2CbSize)
Definition: encoder-types.h:397
PredMode
Definition: slice.h:90
PartMode
Definition: slice.h:75
IntraPredMode
Definition: slice.h:95
Definition: encoder-types.h:221
PBMotion motion
Definition: encoder-types.h:224
PBMotionCoding spec
Definition: encoder-types.h:228