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) { ...@@ -153,6 +153,7 @@ static aom_codec_err_t decoder_destroy(aom_codec_alg_priv_t *ctx) {
return AOM_CODEC_OK; return AOM_CODEC_OK;
} }
#if !CONFIG_OBU
static int parse_bitdepth_colorspace_sampling(BITSTREAM_PROFILE profile, static int parse_bitdepth_colorspace_sampling(BITSTREAM_PROFILE profile,
struct aom_read_bit_buffer *rb) { struct aom_read_bit_buffer *rb) {
aom_color_space_t color_space; aom_color_space_t color_space;
...@@ -200,6 +201,7 @@ static int parse_bitdepth_colorspace_sampling(BITSTREAM_PROFILE profile, ...@@ -200,6 +201,7 @@ static int parse_bitdepth_colorspace_sampling(BITSTREAM_PROFILE profile,
} }
return 1; return 1;
} }
#endif
static aom_codec_err_t decoder_peek_si_internal( static aom_codec_err_t decoder_peek_si_internal(
const uint8_t *data, unsigned int data_sz, aom_codec_stream_info_t *si, 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( ...@@ -229,9 +231,19 @@ static aom_codec_err_t decoder_peek_si_internal(
data += index_size; data += index_size;
data_sz -= 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 show_frame;
int error_resilient; int error_resilient;
struct aom_read_bit_buffer rb = { data, data + data_sz, 0, NULL, NULL }; 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( ...@@ -298,6 +310,7 @@ static aom_codec_err_t decoder_peek_si_internal(
av1_read_frame_size(&rb, (int *)&si->w, (int *)&si->h); av1_read_frame_size(&rb, (int *)&si->w, (int *)&si->h);
} }
} }
#endif
} }
if (is_intra_only != NULL) *is_intra_only = intra_only_flag; if (is_intra_only != NULL) *is_intra_only = intra_only_flag;
return AOM_CODEC_OK; return AOM_CODEC_OK;
......
...@@ -70,6 +70,10 @@ typedef enum { ...@@ -70,6 +70,10 @@ typedef enum {
typedef enum { typedef enum {
KEY_FRAME = 0, KEY_FRAME = 0,
INTER_FRAME = 1, INTER_FRAME = 1,
#if CONFIG_OBU
INTRA_ONLY_FRAME = 2, // replaces intra-only
S_FRAME = 3,
#endif
FRAME_TYPES, FRAME_TYPES,
} FRAME_TYPE; } FRAME_TYPE;
......
...@@ -712,6 +712,18 @@ typedef enum { ...@@ -712,6 +712,18 @@ typedef enum {
} FILTER_DEGREE; } FILTER_DEGREE;
#endif // CONFIG_LPF_DIRECT #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 #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif #endif
......
This diff is collapsed.
...@@ -29,8 +29,25 @@ void av1_read_frame_size(struct aom_read_bit_buffer *rb, int *width, ...@@ -29,8 +29,25 @@ void av1_read_frame_size(struct aom_read_bit_buffer *rb, int *width,
int *height); int *height);
BITSTREAM_PROFILE av1_read_profile(struct aom_read_bit_buffer *rb); 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, void av1_decode_frame(struct AV1Decoder *pbi, const uint8_t *data,
const uint8_t *data_end, const uint8_t **p_data_end); 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 #ifdef __cplusplus
} // extern "C" } // extern "C"
......
...@@ -379,7 +379,21 @@ int av1_receive_compressed_data(AV1Decoder *pbi, size_t size, ...@@ -379,7 +379,21 @@ int av1_receive_compressed_data(AV1Decoder *pbi, size_t size,
} }
cm->error.setjmp = 1; cm->error.setjmp = 1;
#if !CONFIG_OBU
#if 0
// This function is now obsolete
av1_decode_frame(pbi, source, source + size, psource); 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); 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.") ...@@ -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_WARPED_MOTION 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_WEDGE 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_XIPHRC 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_OBU 0 CACHE NUMBER "AV1 experiment flag.")
...@@ -347,6 +347,7 @@ EXPERIMENT_LIST=" ...@@ -347,6 +347,7 @@ EXPERIMENT_LIST="
colorspace_headers colorspace_headers
mfmv mfmv
jnt_comp jnt_comp
obu
amvr amvr
" "
CONFIG_LIST=" CONFIG_LIST="
......
...@@ -44,8 +44,11 @@ TEST(DecodeAPI, InvalidParams) { ...@@ -44,8 +44,11 @@ TEST(DecodeAPI, InvalidParams) {
aom_codec_dec_init(NULL, kCodecs[i], NULL, 0)); aom_codec_dec_init(NULL, kCodecs[i], NULL, 0));
EXPECT_EQ(AOM_CODEC_OK, aom_codec_dec_init(&dec, 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, EXPECT_EQ(AOM_CODEC_UNSUP_BITSTREAM,
aom_codec_decode(&dec, buf, NELEMENTS(buf), NULL, 0)); aom_codec_decode(&dec, buf, NELEMENTS(buf), NULL, 0));
#endif
EXPECT_EQ(AOM_CODEC_INVALID_PARAM, EXPECT_EQ(AOM_CODEC_INVALID_PARAM,
aom_codec_decode(&dec, NULL, NELEMENTS(buf), NULL, 0)); aom_codec_decode(&dec, NULL, NELEMENTS(buf), NULL, 0));
EXPECT_EQ(AOM_CODEC_INVALID_PARAM, aom_codec_decode(&dec, buf, 0, 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