From patchwork Mon Apr 17 02:23:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ruyi Ji X-Patchwork-Id: 3438 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.3.129 with SMTP id 123csp1094173vsd; Sun, 16 Apr 2017 19:31:22 -0700 (PDT) X-Received: by 10.223.130.66 with SMTP id 60mr17412751wrb.59.1492396282060; Sun, 16 Apr 2017 19:31:22 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id r131si9509794wmg.74.2017.04.16.19.31.21; Sun, 16 Apr 2017 19:31:22 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 60BC7680A69; Mon, 17 Apr 2017 05:31:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-yw0-f194.google.com (mail-yw0-f194.google.com [209.85.161.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 98E8A680A69 for ; Mon, 17 Apr 2017 05:31:04 +0300 (EEST) Received: by mail-yw0-f194.google.com with SMTP id 203so9173453ywk.3 for ; Sun, 16 Apr 2017 19:31:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=g3Z7xcscVAKlw1jEsmOvmTiH4Q3I2LU4INMum34g05U=; b=KZ5/zP1wDySSYq0Yd46nNcwNyhQzWJxzNybX0xKWmuogmjYRecSYxNN4OROBb9FUA7 cyu4XH1IY9xQSmFvLwImhZn9mPbAwYEyUjZXzeMKqq7RaRIcc6anR/P6VdyfXtnZeaSJ +c9CoZjT8viSsBhSfkx6uFtlx1z5avfpDqkdVfc/R1wHE5IbIieBxMbv9shR6CUS6Z5D Wc8Qyb7PB6vMf26gB4rzfrrUeHyW9nsAljfdwG1AzdLlIviaEqOo+gwKY5jcKZvQYoTL opUtME3HlX/b1yZG2sxaHkc6tKQLC74yLMjXp6dr6MuKVPG53HNFEjrvDYkHnLGPOD06 OF3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=g3Z7xcscVAKlw1jEsmOvmTiH4Q3I2LU4INMum34g05U=; b=BJYT8aQb6xBvbd3OQOX5VWBhHaNdzQhFxXYkxRjBgzHY63Q1+Ynt9NAWLVC5Cwk1n7 N+ssHmHrKcG7l9xjkvvg3PTgIbEPfibKrSEwlSHi+V/XZvXwF73THbNVWLuPbPrF+TAE S9JXYQaPdNXKPAS2via8g/RX5M1Os3frGj5jedeAr26ODhSnyLB/MDxpDby8ZK9q+cLU Y2qL6dXFR5E6rRyjz+h+Xc2BPtr7/1+UbltS4RErTJtKzBWRE2tSv6aVJxKrJYyx4Tpb 668whz4cNCABup3X4L5R/MVTuCmWSX4RWKrkH8Gun88mm4luso7VOPKjZ13mBRu8ngea VLNg== X-Gm-Message-State: AN3rC/7n8sRXEjuo7bCcY4s5FyRlNrsJtwzr6uY/gV5osUQMbmDc4I9+ dQYz/SceLD7g35ApkQHdfyCnTuZcaw== X-Received: by 10.129.75.149 with SMTP id y143mr15876404ywa.339.1492395786312; Sun, 16 Apr 2017 19:23:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.161.132 with HTTP; Sun, 16 Apr 2017 19:23:05 -0700 (PDT) In-Reply-To: <20170416192551.GR4714@nb4> References: <1492348773-7880-1-git-send-email-jiruyi1@gmail.com> <20170416192551.GR4714@nb4> From: =?UTF-8?B?5rGy5aaC5oSP?= Date: Sun, 16 Apr 2017 22:23:05 -0400 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: Re: [FFmpeg-devel] [PATCH] this is the gsos qualification task which use psychoacoustic system to detect transients in vorbis encoder. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi, I am sorry for my mistakes. I have fixed them. And attachment is the patch which fix error in first one. Thanks. 2017-04-16 15:25 GMT-04:00 Michael Niedermayer : > On Sun, Apr 16, 2017 at 09:19:33AM -0400, Ruyi Ji wrote: > > Signed-off-by: Ruyi Ji > > --- > > libavcodec/psymodel.c | 1 + > > libavcodec/vorbis_enc_data.h | 111 ++++++++++++++++++++++++++++++ > +++++++++++++ > > libavcodec/vorbisenc.c | 60 +++++++++++++++++++++++ > > 3 files changed, 172 insertions(+) > > This seems to fail to build here > > CC libavcodec/vorbisenc.o > libavcodec/vorbisenc.c:133:45: error: ‘MAX_CHANNELS’ undeclared here (not > in a function) > libavcodec/vorbisenc.c: In function ‘vorbis_encode_frame’: > libavcodec/vorbisenc.c:1057:25: error: expected ‘;’ before ‘if’ > libavcodec/vorbisenc.c: In function ‘vorbis_encode_close’: > libavcodec/vorbisenc.c:1196:9: error: incompatible type for argument 1 of > ‘ff_psy_end’ > libavcodec/psymodel.h:176:6: note: expected ‘struct FFPsyContext *’ but > argument is of type ‘FFPsyContext’ > make: *** [libavcodec/vorbisenc.o] Error 1 > make: Target `all' not remade because of errors. > > > > > > diff --git a/libavcodec/psymodel.c b/libavcodec/psymodel.c > > index 2b5f111..2e11c48 100644 > > --- a/libavcodec/psymodel.c > > +++ b/libavcodec/psymodel.c > > @@ -62,6 +62,7 @@ av_cold int ff_psy_init(FFPsyContext *ctx, > AVCodecContext *avctx, int num_lens, > > > > switch (ctx->avctx->codec_id) { > > case AV_CODEC_ID_AAC: > > + case AV_CODEC_ID_VORBIS: > > ctx->model = &ff_aac_psy_model; > > tabs are forbidden in ffmpeg-git except where needed for syntax > > [...] > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > In fact, the RIAA has been known to suggest that students drop out > of college or go to community college in order to be able to afford > settlements. -- The RIAA > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > From 2629cada2ed6aa843736762cfe536c4489628272 Mon Sep 17 00:00:00 2001 From: Ruyi Ji Date: Sun, 16 Apr 2017 21:41:44 -0400 Subject: [PATCH 2/2] this patch is one can build. Signed-off-by: Ruyi Ji --- libavcodec/vorbisenc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavcodec/vorbisenc.c b/libavcodec/vorbisenc.c index 9f1adf8..09ad446 100644 --- a/libavcodec/vorbisenc.c +++ b/libavcodec/vorbisenc.c @@ -98,6 +98,8 @@ typedef struct vorbis_enc_mode { int mapping; } vorbis_enc_mode; +#define MAX_CHANNELS 2 + typedef struct vorbis_enc_context { int channels; int sample_rate; @@ -133,7 +135,6 @@ typedef struct vorbis_enc_context { enum WindowSequence window_sequence[MAX_CHANNELS]; } vorbis_enc_context; -#define MAX_CHANNELS 2 #define MAX_CODEBOOK_DIM 8 #define MAX_FLOOR_CLASS_DIM 4 @@ -1053,7 +1054,7 @@ static int vorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, cur_channel = start_ch + ch; overlap = &audio[cur_channel][0]; samples2 = overlap + 1024; - la = samples2 + (448 + 64) + la = samples2 + (448 + 64); if (!frame) la = NULL; wi[ch] = venc->psy.model->window(&venc->psy, samples2, la, cur_channel, venc->window_sequence[0]); @@ -1193,7 +1194,7 @@ static av_cold int vorbis_encode_close(AVCodecContext *avctx) ff_mdct_end(&venc->mdct[0]); ff_mdct_end(&venc->mdct[1]); - ff_psy_end(venc->psy); + ff_psy_end(&venc->psy); if (venc->psypp) ff_psy_preprocess_end(venc->psypp); -- 1.9.1