Commit 65c00ae1 authored by Soo-Chul Han's avatar Soo-Chul Han

initial implementation of HLS based on R18

Change-Id: I78bb38e3d61d74442278bd5ed1c4f695b7c8e24a
parent b3c189b9
......@@ -153,6 +153,7 @@ static aom_codec_err_t decoder_destroy(aom_codec_alg_priv_t *ctx) {
return AOM_CODEC_OK;
}
#if !CONFIG_OBU
static int parse_bitdepth_colorspace_sampling(BITSTREAM_PROFILE profile,
struct aom_read_bit_buffer *rb) {
aom_color_space_t color_space;
......@@ -200,6 +201,7 @@ static int parse_bitdepth_colorspace_sampling(BITSTREAM_PROFILE profile,
}
return 1;
}
#endif
static aom_codec_err_t decoder_peek_si_internal(
const uint8_t *data, unsigned int data_sz, aom_codec_stream_info_t *si,
......@@ -229,9 +231,19 @@ static aom_codec_err_t decoder_peek_si_internal(
data += index_size;
data_sz -= index_size;
#if CONFIG_OBU
if (data + data_sz <= data) return AOM_CODEC_INVALID_PARAM;
#endif
}
{
#if CONFIG_OBU
// Proper fix needed
si->is_kf = 1;
intra_only_flag = 1;
si->h = 1;
#else
int show_frame;
int error_resilient;
struct aom_read_bit_buffer rb = { data, data + data_sz, 0, NULL, NULL };
......@@ -298,6 +310,7 @@ static aom_codec_err_t decoder_peek_si_internal(
av1_read_frame_size(&rb, (int *)&si->w, (int *)&si->h);
}
}
#endif
}
if (is_intra_only != NULL) *is_intra_only = intra_only_flag;
return AOM_CODEC_OK;
......
......@@ -70,6 +70,10 @@ typedef enum {
typedef enum {
KEY_FRAME = 0,
INTER_FRAME = 1,
#if CONFIG_OBU
INTRA_ONLY_FRAME = 2, // replaces intra-only
S_FRAME = 3,
#endif
FRAME_TYPES,
} FRAME_TYPE;
......
......@@ -712,6 +712,18 @@ typedef enum {
} FILTER_DEGREE;
#endif // CONFIG_LPF_DIRECT
#if CONFIG_OBU
// R19
typedef enum {
OBU_SEQUENCE_HEADER = 1,
OBU_TD = 2,
OBU_FRAME_HEADER = 3,
OBU_TILE_GROUP = 4,
OBU_METADATA = 5,
OBU_PADDING = 15,
} OBU_TYPE;
#endif
#ifdef __cplusplus
} // extern "C"
#endif
......
This diff is collapsed.
......@@ -29,8 +29,25 @@ void av1_read_frame_size(struct aom_read_bit_buffer *rb, int *width,
int *height);
BITSTREAM_PROFILE av1_read_profile(struct aom_read_bit_buffer *rb);
// This function is now obsolete
void av1_decode_frame(struct AV1Decoder *pbi, const uint8_t *data,
const uint8_t *data_end, const uint8_t **p_data_end);
size_t av1_decode_frame_headers_and_setup(struct AV1Decoder *pbi,
const uint8_t *data,
const uint8_t *data_end,
const uint8_t **p_data_end);
void av1_decode_tg_tiles_and_wrapup(struct AV1Decoder *pbi, const uint8_t *data,
const uint8_t *data_end,
const uint8_t **p_data_end, int startTile,
int endTile, int initialize_flag);
#if CONFIG_OBU
// replaces av1_decode_frame
void av1_decode_frame_from_obus(struct AV1Decoder *pbi, const uint8_t *data,
const uint8_t *data_end,
const uint8_t **p_data_end);
#endif
#ifdef __cplusplus
} // extern "C"
......
......@@ -379,7 +379,21 @@ int av1_receive_compressed_data(AV1Decoder *pbi, size_t size,
}
cm->error.setjmp = 1;
#if !CONFIG_OBU
#if 0
// This function is now obsolete
av1_decode_frame(pbi, source, source + size, psource);
#endif
#if 1
if (av1_decode_frame_headers_and_setup(pbi, source, source + size, psource)) {
av1_decode_tg_tiles_and_wrapup(pbi, source, source + size, psource, 0,
cm->tile_rows * cm->tile_cols - 1, 1);
}
#endif
#else
av1_decode_frame_from_obus(pbi, source, source + size, psource);
#endif
swap_frame_buffers(pbi);
......
This diff is collapsed.
......@@ -207,3 +207,4 @@ set(CONFIG_VAR_TX_NO_TX_MODE 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_WARPED_MOTION 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_WEDGE 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_XIPHRC 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_OBU 0 CACHE NUMBER "AV1 experiment flag.")
......@@ -347,6 +347,7 @@ EXPERIMENT_LIST="
colorspace_headers
mfmv
jnt_comp
obu
amvr
"
CONFIG_LIST="
......
......@@ -44,8 +44,11 @@ TEST(DecodeAPI, InvalidParams) {
aom_codec_dec_init(NULL, kCodecs[i], NULL, 0));
EXPECT_EQ(AOM_CODEC_OK, aom_codec_dec_init(&dec, kCodecs[i], NULL, 0));
#if !CONFIG_OBU
// Needs to be fixed
EXPECT_EQ(AOM_CODEC_UNSUP_BITSTREAM,
aom_codec_decode(&dec, buf, NELEMENTS(buf), NULL, 0));
#endif
EXPECT_EQ(AOM_CODEC_INVALID_PARAM,
aom_codec_decode(&dec, NULL, NELEMENTS(buf), NULL, 0));
EXPECT_EQ(AOM_CODEC_INVALID_PARAM, aom_codec_decode(&dec, buf, 0, NULL, 0));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment