[FFmpeg-cvslog] EVRC decoder

Michael Niedermayer michaelni at gmx.at
Mon Feb 11 00:15:15 CET 2013


On Mon, Jan 21, 2013 at 11:31:53AM +0100, Paul B Mahol wrote:
> ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Jan  9 10:56:18 2013 +0000| [098d3891be08ca119e20ad7989668ddef83b31ea] | committer: Paul B Mahol
> 
> EVRC decoder
> 
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
[...]
> +static int evrc_decode_frame(AVCodecContext *avctx, void *data,
> +                             int *got_frame_ptr, AVPacket *avpkt)
> +{
> +    const uint8_t *buf = avpkt->data;
> +    EVRCContext *e     = avctx->priv_data;
> +    int buf_size       = avpkt->size;
> +    float ilspf[FILTER_ORDER], ilpc[FILTER_ORDER], idelay[NB_SUBFRAMES];
> +    float *samples;
> +    int   i, j, ret, error_flag = 0;
> +
> +    e->avframe.nb_samples = 160;
> +    if ((ret = ff_get_buffer(avctx, &e->avframe)) < 0)
> +        return ret;
> +    samples = (float *)e->avframe.data[0];
> +
> +    if ((e->bitrate = determine_bitrate(avctx, &buf_size, &buf)) == RATE_ERRS) {
> +        warn_insufficient_frame_quality(avctx, "bitrate cannot be determined.");
> +        goto erasure;
> +    }
> +    if (e->bitrate <= SILENCE || e->bitrate == RATE_QUARTER)
> +        goto erasure;
> +    if (e->bitrate == RATE_QUANT && e->last_valid_bitrate == RATE_FULL
> +                                 && !e->prev_error_flag)
> +        goto erasure;
> +
> +    init_get_bits(&e->gb, buf, 8 * buf_size);
> +    memset(&e->frame, 0, sizeof(EVRCAFrame));
> +
> +    unpack_frame(e);
> +
> +    if (e->bitrate != RATE_QUANT) {
> +        uint8_t *p = (uint8_t *) &e->frame;
> +        for (i = 0; i < sizeof(EVRCAFrame); i++) {
> +            if (p[i])
> +                break;
> +        }
> +        if (i == sizeof(EVRCAFrame))
> +            goto erasure;

> +    } else if (e->frame.lsp[0] == e->frame.lsp[1] == 0xf &&

This condition is wrong (CID980005 and CID980004)

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-cvslog/attachments/20130211/d0131ebb/attachment.asc>


More information about the ffmpeg-cvslog mailing list