aacenc_is.h 1.76 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
/*
 * AAC encoder intensity stereo
 * Copyright (C) 2015 Rostislav Pehlivanov
 *
 * This file is part of FFmpeg.
 *
 * FFmpeg is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * FFmpeg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with FFmpeg; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

/**
 * @file
 * AAC encoder Intensity Stereo
 * @author Rostislav Pehlivanov ( atomnuker gmail com )
 */

28 29
#ifndef AVCODEC_AACENC_IS_H
#define AVCODEC_AACENC_IS_H
30

31 32
#include "aacenc.h"

33 34 35
/** Frequency in Hz for lower limit of intensity stereo **/
#define INT_STEREO_LOW_LIMIT 6100

36
struct AACISError {
37 38 39 40 41
    int pass;    /* 1 if dist2 <= dist1  */
    int phase;   /* -1 or +1             */
    float error; /* fabs(dist1 - dist2)  */
    float dist1; /* From original coeffs */
    float dist2; /* From IS'd coeffs     */
42
    float ener01;
43 44
};

45 46
struct AACISError ff_aac_is_encoding_err(AACEncContext *s, ChannelElement *cpe,
                                         int start, int w, int g, float ener0,
47 48
                                         float ener1, float ener01,
                                         int use_pcoeffs, int phase);
49
void ff_aac_search_for_is(AACEncContext *s, AVCodecContext *avctx, ChannelElement *cpe);
50

51
#endif /* AVCODEC_AACENC_IS_H */