mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-24 02:24:07 +00:00
Added coeff data to picture-struct
This commit is contained in:
parent
db266e74ff
commit
d9e6d8413d
|
@ -154,6 +154,9 @@ int main(int argc, char *argv[])
|
|||
|
||||
init_encoder_input(&encoder->in, input, cfg->width, cfg->height);
|
||||
|
||||
// Init coeff data table
|
||||
encoder->in.cur_pic->coeff = MALLOC(coefficient, cfg->width * cfg->height);
|
||||
|
||||
// Start coding cycle while data on input and not on the last frame
|
||||
while(!feof(input) && (!cfg->frames || encoder->frame < cfg->frames)) {
|
||||
int32_t diff;
|
||||
|
@ -202,6 +205,10 @@ int main(int argc, char *argv[])
|
|||
// TODO: reuse memory from old reference
|
||||
encoder->in.cur_pic = picture_init(encoder->in.width, encoder->in.height, encoder->in.width_in_lcu, encoder->in.height_in_lcu);
|
||||
|
||||
// Copy pointer from the last cur_pic because we don't want to reallocate it
|
||||
encoder->in.cur_pic->coeff = encoder->ref->pics[0]->coeff;
|
||||
encoder->ref->pics[0]->coeff = NULL;
|
||||
|
||||
encoder->frame++;
|
||||
}
|
||||
// Coding finished
|
||||
|
|
|
@ -244,6 +244,8 @@ picture *picture_init(int32_t width, int32_t height,
|
|||
memset(pic->cu_array[i], 0, sizeof(cu_info) * cu_array_size);
|
||||
}
|
||||
|
||||
pic->coeff = NULL;
|
||||
|
||||
return pic;
|
||||
}
|
||||
|
||||
|
@ -275,6 +277,9 @@ int picture_destroy(picture *pic)
|
|||
free(pic->cu_array);
|
||||
pic->cu_array = NULL;
|
||||
|
||||
free(pic->coeff);
|
||||
pic->coeff = NULL;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -73,6 +73,8 @@ typedef struct
|
|||
pixel* u_recdata; // \brief Pointer to reconstructed U-data.
|
||||
pixel* v_recdata; // \brief Pointer to reconstructed V-data.
|
||||
|
||||
coefficient* coeff; //!< \brief coefficient pointer
|
||||
|
||||
int32_t width; // \brief Luma pixel array width.
|
||||
int32_t height; // \brief Luma pixel array height.
|
||||
int32_t height_in_lcu; // \brief Picture width in number of LCU's.
|
||||
|
|
Loading…
Reference in a new issue