2015-05-18 08:43:10 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
* This file is part of Kvazaar HEVC encoder.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013-2015 Tampere University of Technology and others (see
|
|
|
|
* COPYING file).
|
|
|
|
*
|
|
|
|
* Kvazaar is free software: you can redistribute it and/or modify it under
|
|
|
|
* the terms of the GNU Lesser General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2.1 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*
|
|
|
|
* Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with Kvazaar. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
****************************************************************************/
|
|
|
|
|
2016-04-01 14:14:23 +00:00
|
|
|
#include "kvazaar.h"
|
2015-05-18 08:43:10 +00:00
|
|
|
|
2016-04-01 14:14:23 +00:00
|
|
|
#include <stdio.h>
|
2015-05-18 08:43:10 +00:00
|
|
|
#include <stdlib.h>
|
2016-04-01 14:14:23 +00:00
|
|
|
#include <string.h>
|
2015-05-18 08:43:10 +00:00
|
|
|
|
2016-04-01 14:14:23 +00:00
|
|
|
#include "bitstream.h"
|
2016-01-25 10:08:27 +00:00
|
|
|
#include "cfg.h"
|
2016-04-01 14:14:23 +00:00
|
|
|
#include "checkpoint.h"
|
2015-05-18 08:43:10 +00:00
|
|
|
#include "encoder.h"
|
2016-04-01 14:14:23 +00:00
|
|
|
#include "encoder_state-bitstream.h"
|
|
|
|
#include "encoder_state-ctors_dtors.h"
|
2015-05-18 08:43:10 +00:00
|
|
|
#include "encoderstate.h"
|
2016-04-01 14:14:23 +00:00
|
|
|
#include "global.h"
|
|
|
|
#include "image.h"
|
2015-09-08 05:36:52 +00:00
|
|
|
#include "input_frame_buffer.h"
|
2016-04-01 14:14:23 +00:00
|
|
|
#include "kvazaar_internal.h"
|
|
|
|
#include "strategyselector.h"
|
|
|
|
#include "threadqueue.h"
|
|
|
|
#include "videoframe.h"
|
2015-05-18 08:43:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
static void kvazaar_close(kvz_encoder *encoder)
|
|
|
|
{
|
|
|
|
if (encoder) {
|
2015-06-08 14:29:10 +00:00
|
|
|
if (encoder->states) {
|
|
|
|
for (unsigned i = 0; i < encoder->num_encoder_states; ++i) {
|
2015-08-26 08:50:27 +00:00
|
|
|
kvz_encoder_state_finalize(&encoder->states[i]);
|
2015-06-08 14:29:10 +00:00
|
|
|
}
|
|
|
|
}
|
2015-05-18 08:43:10 +00:00
|
|
|
FREE_POINTER(encoder->states);
|
2015-06-30 06:14:31 +00:00
|
|
|
|
2015-08-26 08:50:27 +00:00
|
|
|
kvz_encoder_control_free(encoder->control);
|
2015-06-30 06:14:31 +00:00
|
|
|
encoder->control = NULL;
|
2015-05-18 08:43:10 +00:00
|
|
|
}
|
|
|
|
FREE_POINTER(encoder);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-06-30 09:04:00 +00:00
|
|
|
static kvz_encoder * kvazaar_open(const kvz_config *cfg)
|
2015-05-18 08:43:10 +00:00
|
|
|
{
|
|
|
|
kvz_encoder *encoder = NULL;
|
|
|
|
|
|
|
|
//Initialize strategies
|
|
|
|
// TODO: Make strategies non-global
|
2015-08-26 08:50:27 +00:00
|
|
|
if (!kvz_strategyselector_init(cfg->cpuid, KVZ_BIT_DEPTH)) {
|
2015-05-18 08:43:10 +00:00
|
|
|
fprintf(stderr, "Failed to initialize strategies.\n");
|
|
|
|
goto kvazaar_open_failure;
|
|
|
|
}
|
|
|
|
|
2015-08-26 08:50:27 +00:00
|
|
|
kvz_init_exp_golomb();
|
2015-05-18 08:43:10 +00:00
|
|
|
|
2015-06-30 06:14:31 +00:00
|
|
|
encoder = calloc(1, sizeof(kvz_encoder));
|
2015-05-18 08:43:10 +00:00
|
|
|
if (!encoder) {
|
|
|
|
goto kvazaar_open_failure;
|
|
|
|
}
|
|
|
|
|
2016-09-27 19:12:02 +00:00
|
|
|
// FIXME: const qualifier disgarded. I don't want to change kvazaar_open
|
|
|
|
// but I really need to change cfg.
|
|
|
|
encoder->control = kvz_encoder_control_init((kvz_config*)cfg);
|
2015-06-30 06:14:31 +00:00
|
|
|
if (!encoder->control) {
|
2015-05-18 08:43:10 +00:00
|
|
|
goto kvazaar_open_failure;
|
|
|
|
}
|
|
|
|
|
2015-06-30 06:14:31 +00:00
|
|
|
encoder->num_encoder_states = encoder->control->owf + 1;
|
2015-05-18 08:43:10 +00:00
|
|
|
encoder->cur_state_num = 0;
|
2015-07-07 07:05:42 +00:00
|
|
|
encoder->out_state_num = 0;
|
2015-05-19 14:48:37 +00:00
|
|
|
encoder->frames_started = 0;
|
2015-06-03 17:09:36 +00:00
|
|
|
encoder->frames_done = 0;
|
2015-09-08 05:52:23 +00:00
|
|
|
|
|
|
|
kvz_init_input_frame_buffer(&encoder->input_buffer);
|
|
|
|
|
2015-06-30 06:14:31 +00:00
|
|
|
encoder->states = calloc(encoder->num_encoder_states, sizeof(encoder_state_t));
|
2015-05-18 08:43:10 +00:00
|
|
|
if (!encoder->states) {
|
|
|
|
goto kvazaar_open_failure;
|
|
|
|
}
|
|
|
|
|
2015-06-30 06:14:31 +00:00
|
|
|
for (unsigned i = 0; i < encoder->num_encoder_states; ++i) {
|
2015-05-18 08:43:10 +00:00
|
|
|
encoder->states[i].encoder_control = encoder->control;
|
|
|
|
|
2015-08-26 08:50:27 +00:00
|
|
|
if (!kvz_encoder_state_init(&encoder->states[i], NULL)) {
|
2015-05-18 08:43:10 +00:00
|
|
|
goto kvazaar_open_failure;
|
|
|
|
}
|
|
|
|
|
2016-08-10 00:46:23 +00:00
|
|
|
encoder->states[i].frame->QP = (int8_t)cfg->qp;
|
2015-05-18 08:43:10 +00:00
|
|
|
}
|
|
|
|
|
2015-06-30 06:14:31 +00:00
|
|
|
for (int i = 0; i < encoder->num_encoder_states; ++i) {
|
2015-05-18 08:43:10 +00:00
|
|
|
if (i == 0) {
|
|
|
|
encoder->states[i].previous_encoder_state = &encoder->states[encoder->num_encoder_states - 1];
|
|
|
|
} else {
|
|
|
|
encoder->states[i].previous_encoder_state = &encoder->states[(i - 1) % encoder->num_encoder_states];
|
|
|
|
}
|
2015-08-26 08:50:27 +00:00
|
|
|
kvz_encoder_state_match_children_of_previous_frame(&encoder->states[i]);
|
2015-05-18 08:43:10 +00:00
|
|
|
}
|
|
|
|
|
2016-08-10 00:46:23 +00:00
|
|
|
encoder->states[encoder->cur_state_num].frame->num = -1;
|
2015-05-18 08:43:10 +00:00
|
|
|
|
|
|
|
return encoder;
|
|
|
|
|
|
|
|
kvazaar_open_failure:
|
|
|
|
kvazaar_close(encoder);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-09-08 10:59:55 +00:00
|
|
|
static void set_frame_info(kvz_frame_info *const info, const encoder_state_t *const state)
|
|
|
|
{
|
2016-08-10 00:46:23 +00:00
|
|
|
info->poc = state->frame->poc,
|
|
|
|
info->qp = state->frame->QP;
|
|
|
|
info->nal_unit_type = state->frame->pictype;
|
|
|
|
info->slice_type = state->frame->slicetype;
|
2015-09-09 07:16:59 +00:00
|
|
|
kvz_encoder_get_ref_lists(state, info->ref_list_len, info->ref_list);
|
2015-09-08 10:59:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-10-14 10:47:23 +00:00
|
|
|
static int kvazaar_headers(kvz_encoder *enc,
|
|
|
|
kvz_data_chunk **data_out,
|
|
|
|
uint32_t *len_out)
|
|
|
|
{
|
|
|
|
if (data_out) *data_out = NULL;
|
|
|
|
if (len_out) *len_out = 0;
|
|
|
|
|
|
|
|
bitstream_t stream;
|
|
|
|
kvz_bitstream_init(&stream);
|
|
|
|
|
|
|
|
kvz_encoder_state_write_parameter_sets(&stream, &enc->states[enc->cur_state_num]);
|
|
|
|
|
|
|
|
// Get stream length before taking chunks since that clears the stream.
|
|
|
|
if (len_out) *len_out = kvz_bitstream_tell(&stream) / 8;
|
|
|
|
if (data_out) *data_out = kvz_bitstream_take_chunks(&stream);
|
|
|
|
|
2015-10-23 06:55:08 +00:00
|
|
|
kvz_bitstream_finalize(&stream);
|
2015-10-14 10:47:23 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-01-25 17:05:10 +00:00
|
|
|
/**
|
|
|
|
* \brief Separate a single field from a frame.
|
|
|
|
*
|
|
|
|
* \param frame_in input frame to extract field from
|
|
|
|
* \param source_scan_type scan type of input material (0: progressive, 1:top field first, 2:bottom field first)
|
|
|
|
* \param field parity
|
|
|
|
* \param field_out
|
|
|
|
*
|
|
|
|
* \return 1 on success, 0 on failure
|
|
|
|
*/
|
|
|
|
static int yuv_io_extract_field(const kvz_picture *frame_in, unsigned source_scan_type, unsigned field_parity, kvz_picture *field_out)
|
|
|
|
{
|
|
|
|
if ((source_scan_type != 1) && (source_scan_type != 2)) return 0;
|
|
|
|
if ((field_parity != 0) && (field_parity != 1)) return 0;
|
|
|
|
|
|
|
|
unsigned offset = 0;
|
|
|
|
if (source_scan_type == 1) offset = field_parity ? 1 : 0;
|
|
|
|
else if (source_scan_type == 2) offset = field_parity ? 0 : 1;
|
|
|
|
|
|
|
|
//Luma
|
|
|
|
for (int i = 0; i < field_out->height; ++i){
|
|
|
|
kvz_pixel *row_in = frame_in->y + MIN(frame_in->height - 1, 2 * i + offset) * frame_in->stride;
|
|
|
|
kvz_pixel *row_out = field_out->y + i * field_out->stride;
|
|
|
|
memcpy(row_out, row_in, sizeof(kvz_pixel) * frame_in->width);
|
|
|
|
}
|
|
|
|
|
|
|
|
//Chroma
|
|
|
|
for (int i = 0; i < field_out->height / 2; ++i){
|
|
|
|
kvz_pixel *row_in = frame_in->u + MIN(frame_in->height / 2 - 1, 2 * i + offset) * frame_in->stride / 2;
|
|
|
|
kvz_pixel *row_out = field_out->u + i * field_out->stride / 2;
|
|
|
|
memcpy(row_out, row_in, sizeof(kvz_pixel) * frame_in->width / 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int i = 0; i < field_out->height / 2; ++i){
|
|
|
|
kvz_pixel *row_in = frame_in->v + MIN(frame_in->height / 2 - 1, 2 * i + offset) * frame_in->stride / 2;
|
|
|
|
kvz_pixel *row_out = field_out->v + i * field_out->stride / 2;
|
|
|
|
memcpy(row_out, row_in, sizeof(kvz_pixel) * frame_in->width / 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-06-30 09:04:00 +00:00
|
|
|
static int kvazaar_encode(kvz_encoder *enc,
|
|
|
|
kvz_picture *pic_in,
|
2015-06-30 09:22:30 +00:00
|
|
|
kvz_data_chunk **data_out,
|
|
|
|
uint32_t *len_out,
|
2015-09-08 10:59:55 +00:00
|
|
|
kvz_picture **pic_out,
|
2015-09-09 08:21:39 +00:00
|
|
|
kvz_picture **src_out,
|
2015-09-08 10:59:55 +00:00
|
|
|
kvz_frame_info *info_out)
|
2015-05-18 08:43:10 +00:00
|
|
|
{
|
2015-06-30 09:04:00 +00:00
|
|
|
if (data_out) *data_out = NULL;
|
2015-06-30 09:22:30 +00:00
|
|
|
if (len_out) *len_out = 0;
|
|
|
|
if (pic_out) *pic_out = NULL;
|
2015-09-09 08:21:39 +00:00
|
|
|
if (src_out) *src_out = NULL;
|
2015-05-19 14:48:37 +00:00
|
|
|
|
2015-06-18 06:10:47 +00:00
|
|
|
encoder_state_t *state = &enc->states[enc->cur_state_num];
|
2015-05-19 14:48:37 +00:00
|
|
|
|
2015-06-18 06:10:47 +00:00
|
|
|
if (!state->prepared) {
|
2016-06-20 00:36:21 +00:00
|
|
|
kvz_encoder_prepare(state);
|
2015-06-18 06:10:47 +00:00
|
|
|
}
|
|
|
|
|
2015-06-30 09:04:00 +00:00
|
|
|
if (pic_in != NULL) {
|
2015-06-18 06:10:47 +00:00
|
|
|
// FIXME: The frame number printed here is wrong when GOP is enabled.
|
2016-08-10 00:46:23 +00:00
|
|
|
CHECKPOINT_MARK("read source frame: %d", state->frame->num + enc->control->cfg->seek);
|
2015-06-18 06:10:47 +00:00
|
|
|
}
|
2015-05-19 14:48:37 +00:00
|
|
|
|
2016-06-20 00:36:21 +00:00
|
|
|
kvz_picture* frame = kvz_encoder_feed_frame(&enc->input_buffer, state, pic_in);
|
|
|
|
if (frame) {
|
2016-08-10 00:46:23 +00:00
|
|
|
assert(state->frame->num == enc->frames_started);
|
2015-06-18 06:10:47 +00:00
|
|
|
// Start encoding.
|
2016-06-20 00:36:21 +00:00
|
|
|
kvz_encode_one_frame(state, frame);
|
2015-06-18 06:10:47 +00:00
|
|
|
enc->frames_started += 1;
|
2015-05-19 14:48:37 +00:00
|
|
|
}
|
|
|
|
|
2015-06-03 17:09:36 +00:00
|
|
|
// If we have finished encoding as many frames as we have started, we are done.
|
|
|
|
if (enc->frames_done == enc->frames_started) {
|
2015-06-18 06:10:47 +00:00
|
|
|
return 1;
|
2015-06-03 17:09:36 +00:00
|
|
|
}
|
|
|
|
|
2015-06-18 06:10:47 +00:00
|
|
|
if (!state->frame_done) {
|
2015-07-07 07:05:42 +00:00
|
|
|
// We started encoding a frame; move to the next encoder state.
|
|
|
|
enc->cur_state_num = (enc->cur_state_num + 1) % (enc->num_encoder_states);
|
|
|
|
}
|
|
|
|
|
|
|
|
encoder_state_t *output_state = &enc->states[enc->out_state_num];
|
|
|
|
if (!output_state->frame_done &&
|
|
|
|
(pic_in == NULL || enc->cur_state_num == enc->out_state_num)) {
|
|
|
|
|
2015-08-26 08:50:27 +00:00
|
|
|
kvz_threadqueue_waitfor(enc->control->threadqueue, output_state->tqj_bitstream_written);
|
2015-09-07 12:08:31 +00:00
|
|
|
// The job pointer must be set to NULL here since it won't be usable after
|
|
|
|
// the next frame is done.
|
|
|
|
output_state->tqj_bitstream_written = NULL;
|
2015-06-18 06:10:47 +00:00
|
|
|
|
2015-06-30 09:22:30 +00:00
|
|
|
// Get stream length before taking chunks since that clears the stream.
|
2015-08-26 08:50:27 +00:00
|
|
|
if (len_out) *len_out = kvz_bitstream_tell(&output_state->stream) / 8;
|
|
|
|
if (data_out) *data_out = kvz_bitstream_take_chunks(&output_state->stream);
|
|
|
|
if (pic_out) *pic_out = kvz_image_copy_ref(output_state->tile->frame->rec);
|
2015-09-09 08:21:39 +00:00
|
|
|
if (src_out) *src_out = kvz_image_copy_ref(output_state->tile->frame->source);
|
2015-09-08 10:59:55 +00:00
|
|
|
if (info_out) set_frame_info(info_out, output_state);
|
2015-06-03 17:09:36 +00:00
|
|
|
|
2015-07-07 07:05:42 +00:00
|
|
|
output_state->frame_done = 1;
|
|
|
|
output_state->prepared = 0;
|
2015-06-18 06:10:47 +00:00
|
|
|
enc->frames_done += 1;
|
2015-07-07 07:05:42 +00:00
|
|
|
|
|
|
|
enc->out_state_num = (enc->out_state_num + 1) % (enc->num_encoder_states);
|
2015-05-19 14:48:37 +00:00
|
|
|
}
|
|
|
|
|
2015-06-03 17:09:36 +00:00
|
|
|
return 1;
|
2015-05-18 08:43:10 +00:00
|
|
|
}
|
|
|
|
|
2015-07-13 11:20:21 +00:00
|
|
|
|
2016-01-25 17:05:10 +00:00
|
|
|
static int kvazaar_field_encoding_adapter(kvz_encoder *enc,
|
|
|
|
kvz_picture *pic_in,
|
|
|
|
kvz_data_chunk **data_out,
|
|
|
|
uint32_t *len_out,
|
|
|
|
kvz_picture **pic_out,
|
|
|
|
kvz_picture **src_out,
|
|
|
|
kvz_frame_info *info_out)
|
|
|
|
{
|
|
|
|
if (enc->control->cfg->source_scan_type == KVZ_INTERLACING_NONE) {
|
|
|
|
// For progressive, simply call the normal encoding function.
|
|
|
|
return kvazaar_encode(enc, pic_in, data_out, len_out, pic_out, src_out, info_out);
|
|
|
|
}
|
|
|
|
|
|
|
|
// For interlaced, make two fields out of the input frame and call encode on them separately.
|
|
|
|
encoder_state_t *state = &enc->states[enc->cur_state_num];
|
|
|
|
kvz_picture *first_field = NULL, *second_field = NULL;
|
|
|
|
struct {
|
|
|
|
kvz_data_chunk* data_out;
|
|
|
|
uint32_t len_out;
|
2016-06-07 03:03:21 +00:00
|
|
|
} first = { 0, 0 }, second = { 0, 0 };
|
2016-01-25 17:05:10 +00:00
|
|
|
|
|
|
|
if (pic_in != NULL) {
|
2016-08-16 16:03:21 +00:00
|
|
|
first_field = kvz_image_alloc(state->encoder_control->chroma_format, state->encoder_control->in.width, state->encoder_control->in.height);
|
2016-01-25 17:05:10 +00:00
|
|
|
if (first_field == NULL) {
|
|
|
|
goto kvazaar_field_encoding_adapter_failure;
|
|
|
|
}
|
2016-08-16 16:03:21 +00:00
|
|
|
second_field = kvz_image_alloc(state->encoder_control->chroma_format, state->encoder_control->in.width, state->encoder_control->in.height);
|
2016-01-25 17:05:10 +00:00
|
|
|
if (second_field == NULL) {
|
|
|
|
goto kvazaar_field_encoding_adapter_failure;
|
|
|
|
}
|
|
|
|
|
|
|
|
yuv_io_extract_field(pic_in, pic_in->interlacing, 0, first_field);
|
|
|
|
yuv_io_extract_field(pic_in, pic_in->interlacing, 1, second_field);
|
|
|
|
|
|
|
|
first_field->pts = pic_in->pts;
|
|
|
|
first_field->dts = pic_in->dts;
|
|
|
|
first_field->interlacing = pic_in->interlacing;
|
|
|
|
|
|
|
|
// Should the second field have higher pts and dts? It shouldn't affect anything.
|
|
|
|
second_field->pts = pic_in->pts;
|
|
|
|
second_field->dts = pic_in->dts;
|
|
|
|
second_field->interlacing = pic_in->interlacing;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!kvazaar_encode(enc, first_field, &first.data_out, &first.len_out, pic_out, NULL, info_out)) {
|
|
|
|
goto kvazaar_field_encoding_adapter_failure;
|
|
|
|
}
|
|
|
|
if (!kvazaar_encode(enc, second_field, &second.data_out, &second.len_out, NULL, NULL, NULL)) {
|
|
|
|
goto kvazaar_field_encoding_adapter_failure;
|
|
|
|
}
|
|
|
|
|
|
|
|
kvz_image_free(first_field);
|
|
|
|
kvz_image_free(second_field);
|
|
|
|
|
|
|
|
// Concatenate bitstreams.
|
|
|
|
if (len_out != NULL) {
|
|
|
|
*len_out = first.len_out + second.len_out;
|
|
|
|
}
|
|
|
|
if (data_out != NULL) {
|
|
|
|
*data_out = first.data_out;
|
|
|
|
if (first.data_out != NULL) {
|
|
|
|
kvz_data_chunk *chunk = first.data_out;
|
|
|
|
while (chunk->next != NULL) {
|
|
|
|
chunk = chunk->next;
|
|
|
|
}
|
|
|
|
chunk->next = second.data_out;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (src_out != NULL) {
|
|
|
|
// TODO: deinterlace the fields to one picture.
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
kvazaar_field_encoding_adapter_failure:
|
|
|
|
kvz_image_free(first_field);
|
|
|
|
kvz_image_free(second_field);
|
|
|
|
kvz_bitstream_free_chunks(first.data_out);
|
|
|
|
kvz_bitstream_free_chunks(second.data_out);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-07-13 11:20:21 +00:00
|
|
|
static const kvz_api kvz_8bit_api = {
|
2015-08-26 08:50:27 +00:00
|
|
|
.config_alloc = kvz_config_alloc,
|
|
|
|
.config_init = kvz_config_init,
|
|
|
|
.config_destroy = kvz_config_destroy,
|
|
|
|
.config_parse = kvz_config_parse,
|
2015-05-18 08:43:10 +00:00
|
|
|
|
2016-08-16 16:03:21 +00:00
|
|
|
.picture_alloc = kvz_image_alloc_420,
|
2015-08-26 08:50:27 +00:00
|
|
|
.picture_free = kvz_image_free,
|
2015-06-30 09:11:58 +00:00
|
|
|
|
2015-08-26 08:50:27 +00:00
|
|
|
.chunk_free = kvz_bitstream_free_chunks,
|
2015-06-30 09:04:00 +00:00
|
|
|
|
2015-05-18 08:43:10 +00:00
|
|
|
.encoder_open = kvazaar_open,
|
|
|
|
.encoder_close = kvazaar_close,
|
2015-10-14 10:47:23 +00:00
|
|
|
.encoder_headers = kvazaar_headers,
|
2016-01-25 17:05:10 +00:00
|
|
|
.encoder_encode = kvazaar_field_encoding_adapter,
|
2016-08-16 16:03:21 +00:00
|
|
|
|
|
|
|
.picture_alloc_csp = kvz_image_alloc,
|
2015-05-18 08:43:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const kvz_api * kvz_api_get(int bit_depth)
|
|
|
|
{
|
|
|
|
return &kvz_8bit_api;
|
|
|
|
}
|