From fbaabc13f0111296a64e565f7b8779b7f67602ca Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin <jean-marc.valin@octasic.com> Date: Mon, 5 Jul 2010 15:47:04 -0400 Subject: [PATCH] IETF draft update, minor bugfix to the encoder --- Makefile | 2 +- doc/draft-valin-codec-prototype.xml | 44 +++++++++++++++++++++-------- src/hybrid_decoder.c | 4 +-- src/hybrid_encoder.c | 8 ++++-- 4 files changed, 41 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 22e95606c..e750dd4f9 100644 --- a/Makefile +++ b/Makefile @@ -5,5 +5,5 @@ celt: (cd celt; make) silk: - (cd celt; silk) + (cd silk; make) diff --git a/doc/draft-valin-codec-prototype.xml b/doc/draft-valin-codec-prototype.xml index 92fd029c6..681b4f423 100644 --- a/doc/draft-valin-codec-prototype.xml +++ b/doc/draft-valin-codec-prototype.xml @@ -18,20 +18,22 @@ <code></code> <country>Canada</country> </postal> +<phone>+1 514 383-8858</phone> <email>jean-marc.valin@octasic.com</email> </address> </author> <author initials="K." surname="Vos" fullname="Koen Vos"> -<organization>Skype</organization> +<organization>Skype Technologies S.A.</organization> <address> <postal> -<street></street> -<city></city> +<street>Stadsgaarden 6</street> +<city>Stockholm</city> <region></region> -<code></code> -<country></country> +<code>11645</code> +<country>SE</country> </postal> +<phone>+46 855 921 989</phone> <email>koen.vos@skype.net</email> </address> </author> @@ -78,6 +80,31 @@ not prevent inclusion of code from other codecs as well. <t>This is a work in progress.</t> </section> +<section anchor="hybrid" title="Hybrid Codec"> + +<t> +In hybrid mode, each frame is coded first by the LP layer and then by the MDCT +layer. In the current prototype, the cutoff frequency is 8 kHz. In the MDCT +layer, all bands below 8 kHz are discarded, such that there is no coding +redundancy between the two layers. Also both layers use the same instance of +the range coder to encode the signal, which ensures that no "padding bits" are +wasted. +</t> + +<section title="Source Code"> +<t> +The source code is currently available in a +<eref target='git://git.xiph.org/users/jm/ietfcodec.git'>Git repository</eref> +which references two other +repositories (for SILK and CELT). Although the build system is very primitive +(and inconsistent), some instructions are provided in the toplevel README file. +This is very early development so both the quality and feature set should +greatly improve over time. +</t> +</section> + +</section> + <section anchor="modes" title="Codec Modes"> <t> There are three possible operating modes for the proposed prototype: @@ -217,13 +244,6 @@ Three frames of different *durations*: </t> </section> -<section anchor="coding-frames" title="Coding of Frames"> - -<t> -In hybrid mode, each frame is coded first by the LP layer and then by the MDCT layer -- which discards the frequency components already encoded. Both use the same instance of the range coder to encode the signal. -</t> - -</section> </section> diff --git a/src/hybrid_decoder.c b/src/hybrid_decoder.c index 2c0885bc1..f2da7380a 100644 --- a/src/hybrid_decoder.c +++ b/src/hybrid_decoder.c @@ -1,5 +1,5 @@ -/* Copyright (c) 2010 Xiph.Org Foundation - Written by Jean-Marc Valin */ +/* Copyright (c) 2010 Xiph.Org Foundation, Skype Limited + Written by Jean-Marc Valin and Koen Vos */ /* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/src/hybrid_encoder.c b/src/hybrid_encoder.c index 85201ade5..21d1573fe 100644 --- a/src/hybrid_encoder.c +++ b/src/hybrid_encoder.c @@ -1,5 +1,5 @@ -/* Copyright (c) 2010 Xiph.Org Foundation - Written by Jean-Marc Valin */ +/* Copyright (c) 2010 Xiph.Org Foundation, Skype Limited + Written by Jean-Marc Valin and Koen Vos */ /* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -34,6 +34,7 @@ #endif #include <stdlib.h> +#include <stdio.h> #include "hybrid_encoder.h" #include "celt/libcelt/entenc.h" #include "celt/libcelt/modes.h" @@ -92,8 +93,10 @@ int hybrid_encode(HybridEncoder *st, const short *pcm, int frame_size, st->encControl.bitRate = 30000; /* Call SILK encoder for the low band */ + nBytes = bytes_per_packet; silk_ret = SKP_Silk_SDK_Encode( st->silk_enc, &st->encControl, pcm, 960, &enc, &nBytes ); if( silk_ret ) { + fprintf (stderr, "SILK encode error\n"); /* Handle error */ } @@ -101,6 +104,7 @@ int hybrid_encode(HybridEncoder *st, const short *pcm, int frame_size, celt_encoder_ctl(st->celt_enc, CELT_SET_START_BAND(13)); /* Encode high band with CELT */ + /* FIXME: Do some delay compensation here */ celt_ret = celt_encode_with_ec(st->celt_enc, pcm, NULL, frame_size, data, bytes_per_packet, &enc); return celt_ret; -- GitLab