summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2015-11-30 11:34:31 +0100
committerAlfred E. Heggestad <aeh@db.org>2015-11-30 11:34:31 +0100
commitde3b4b5659dcb60e368cd792ad4b10d7a43fd0fb (patch)
tree049f7ff7c1e0e8c2c5994b5da0466e70fcdd4852 /modules
parent02ab69889505e114941b75456b95884d2847d329 (diff)
daala: update to latest libdaala api
Diffstat (limited to 'modules')
-rw-r--r--modules/daala/decode.c25
-rw-r--r--modules/daala/encode.c15
2 files changed, 21 insertions, 19 deletions
diff --git a/modules/daala/decode.c b/modules/daala/decode.c
index 7b6170f..a2c264f 100644
--- a/modules/daala/decode.c
+++ b/modules/daala/decode.c
@@ -104,26 +104,21 @@ int daala_decode(struct viddec_state *vds, struct vidframe *frame,
++vds->stats.n_packet;
++vds->stats.valid;
- ishdr = daala_packet_isheader(mbuf_buf(mb), mbuf_get_left(mb));
-
- if (ishdr)
- ++vds->stats.n_header;
- else if (daala_packet_iskeyframe(mbuf_buf(mb), mbuf_get_left(mb)) > 0)
- ++vds->stats.n_keyframe;
-
-#if 0
- re_printf("decode: [%s] %zu bytes\n",
- ishdr ? "HEADER" : "DATA",
- mbuf_get_left(mb));
-#endif
-
memset(&dp, 0, sizeof(dp));
dp.packet = mbuf_buf(mb);
dp.bytes = mbuf_get_left(mb);
dp.b_o_s = marker;
- if (daala_packet_isheader(mbuf_buf(mb), mbuf_get_left(mb))) {
+ ishdr = daala_packet_isheader(&dp);
+
+ if (ishdr)
+ ++vds->stats.n_header;
+ else if (daala_packet_iskeyframe(&dp) > 0)
+ ++vds->stats.n_keyframe;
+
+
+ if (daala_packet_isheader(&dp)) {
r = daala_decode_header_in(&vds->di, &vds->dc, &vds->ds,
&dp);
@@ -137,7 +132,7 @@ int daala_decode(struct viddec_state *vds, struct vidframe *frame,
vds->got_headers = true;
info("daala: all headers received\n");
- vds->dec = daala_decode_alloc(&vds->di, vds->ds);
+ vds->dec = daala_decode_create(&vds->di, vds->ds);
if (!vds->dec) {
warning("daala: decoder: alloc failed\n");
return ENOMEM;
diff --git a/modules/daala/encode.c b/modules/daala/encode.c
index 6b0249d..7770bd6 100644
--- a/modules/daala/encode.c
+++ b/modules/daala/encode.c
@@ -45,8 +45,15 @@ static void dump_stats(const struct videnc_state *ves)
static int send_packet(struct videnc_state *ves, bool marker,
const uint8_t *pld, size_t pld_len)
{
+ daala_packet dp;
int err;
+ memset(&dp, 0, sizeof(dp));
+
+ dp.packet = (uint8_t *)pld;
+ dp.bytes = pld_len;
+ dp.b_o_s = marker;
+
err = ves->pkth(marker, NULL, 0, pld, pld_len, ves->arg);
if (err)
return err;
@@ -54,9 +61,9 @@ static int send_packet(struct videnc_state *ves, bool marker,
++ves->stats.n_packet;
++ves->stats.valid;
- if (daala_packet_isheader(pld, pld_len))
+ if (daala_packet_isheader(&dp))
++ves->stats.n_header;
- else if (daala_packet_iskeyframe(pld, pld_len) > 0)
+ else if (daala_packet_iskeyframe(&dp) > 0)
++ves->stats.n_keyframe;
return 0;
@@ -181,8 +188,8 @@ static int open_encoder(struct videnc_state *ves, const struct vidsz *size)
debug("daala: header: %lld bytes header=%d key=%d\n",
dp.bytes,
- daala_packet_isheader(dp.packet, dp.bytes),
- daala_packet_iskeyframe(dp.packet, dp.bytes));
+ daala_packet_isheader(&dp),
+ daala_packet_iskeyframe(&dp));
#if 0
re_printf("bos=%lld, eos=%lld, granule=%lld, packetno=%lld\n",