From patchwork Sat Jun 3 20:49:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 3823 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.10.2 with SMTP id 2csp739696vsk; Sat, 3 Jun 2017 13:49:52 -0700 (PDT) X-Received: by 10.223.176.9 with SMTP id f9mr8852701wra.106.1496522992027; Sat, 03 Jun 2017 13:49:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496522991; cv=none; d=google.com; s=arc-20160816; b=jjTGcghxaB40UApfGk3BWl/G/dCFK1P7pKoU9l7zv5gZZhIjpavsLsndLwbeAxRX6w wlorSJb9eR2uAMhKCVm+duhru7H71XY7Q00A5Merofplk5Gs56z5TSu2HqlRSuB/l3kV Fa5gQS63kTFciQeXLVWwNd8R1Qd5JNAG0NO+ss+vdOZ8rXWvWexuxj3NF6zNqw//zhbF dGyyWu10aHSDNkUgZ5g4EQcRXDHdosBYwACKmAy5sM1hp6/HOO6TL2B9tz8V3gGCDhCJ BJYHFtDi2X36wAP2g/JtndZZ76jjepvEJA0mGw06zgwFJzlHlzeekToJSGyAUrYGlQJh 4zKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=dN1Kl5bHTvyoziiPNWfY2NH55AjQzd9Yh8SbprMIMdo=; b=PDzjC/0xtMeKa7QOKacf74NYkdh+J/cdIVfw3nhKGCDPU6S+yjtUniLXNLBt4lMbRt aHFN5MjC9ml+EzHX7e6g71wZ1Ci/bw8G8F0S0c+rvqjZhZPDzbmBOx6wXdCgax3mhfbi M8q+IQYyn3px2z3XOHXWEQEa6ShJ5ZLlqobINHbX9N8oW1GycIna4PUjJMiXseEgVEqv Xd9E/JCXZ74CX4cNhF16koZsrmewukGyK3IRAYeXlbHbZvEsCx0H/zAthMPFlRG+9QCN gz5BI2Iz3Yq0zXcl4oeLdhGKP80oLaTW6nTsOthec++8SvIyMd5VLfkHE1LyJyd0cix9 Me7w== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 32si7346992wrj.35.2017.06.03.13.49.51; Sat, 03 Jun 2017 13:49:51 -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 8B835689D42; Sat, 3 Jun 2017 23:49:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr0-f169.google.com (mail-wr0-f169.google.com [209.85.128.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D3439689AE1 for ; Sat, 3 Jun 2017 23:49:35 +0300 (EEST) Received: by mail-wr0-f169.google.com with SMTP id v111so14702151wrc.3 for ; Sat, 03 Jun 2017 13:49:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=zBOdW9+BiM+Dsga/UiFJC5P81pKyUQwiKtR8Ze5PQks=; b=LdAN1JGS0VKMcmK9FIp3z5tlFO8Ro1dWV731ZMmqqd2b3H4ajQQF/hB8FpGoZVU36x ICM2TawjXWxVrSqXj2t3noKlz1Hv2c1Uw0BsumrgNpT8d/zjrhYKXhQPRIfqAY24N359 O0YBMRZyKh4wQcR/MkYCi3uOYLDLBl0psWgvdXuDtlY/kKnFJc0gZyg1GR/zQgPxaxxT VYuBJ7J/OFI8N2knqo3uVy47ZD2jkUiL+asWJQ3QuUpzjKRYRpoFgosi7Jy7n7UrbWxP PiJBsHJBwUMy/dL+/lA8PcoaWvQTbeM3YnuQoU1S7DdcqWj0qlBvxocc540y6C6frj17 lELA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=zBOdW9+BiM+Dsga/UiFJC5P81pKyUQwiKtR8Ze5PQks=; b=CG/ktn+XnIxgdPlmKVmYyv6xk2nwIl3F5BrNXEVPIbotsElqPAmTaiFRxyN5kQFHMW JxHJ6NnvmArjlf+wJPdeKobB812EC9t3gjWygAQXXvZQQKXUxVZgUa4pdT/h5yw9Z1BR aqFJRUyDE2Rv2nWznNy++mdqulhGqmmkod45SyM0uyUccRMSOz+392+NF+eEQttY1VfC 9US9v9t5fNt2uoxhUQqFCJxmq9EpglImfG3eBd4NQT+izG63mKy+z2yfvThUC42GqDWW LUdo6gUdXcyL1Q5m3RXtgbM+/tOsyo46VuxR0dVAC13ZEyF/fCn8Z0vSSFu8hPL4EmCx uUjg== X-Gm-Message-State: AODbwcCOhnrdqXLqVpOE+STDhy6wF1wrGRe4vkBXBmJ4fnfNhzcsUZQr eeU7d8PtqXKFE7Wt X-Received: by 10.223.153.107 with SMTP id x98mr8415259wrb.190.1496522980947; Sat, 03 Jun 2017 13:49:40 -0700 (PDT) Received: from localhost.localdomain ([94.250.174.60]) by smtp.gmail.com with ESMTPSA id s13sm3464096wma.21.2017.06.03.13.49.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Jun 2017 13:49:39 -0700 (PDT) From: Paul B Mahol To: ffmpeg-devel@ffmpeg.org Date: Sat, 3 Jun 2017 22:49:30 +0200 Message-Id: <20170603204930.7609-1-onemda@gmail.com> X-Mailer: git-send-email 2.9.3 Subject: [FFmpeg-devel] [PATCH] avfilter/af_surround: add support for some upmixing of 3.0 channel layout 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Paul B Mahol --- doc/filters.texi | 8 +- libavfilter/af_surround.c | 283 ++++++++++++++++++++++++++++++++++++---------- 2 files changed, 231 insertions(+), 60 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index d4fbb5a..65eef89 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -3795,7 +3795,7 @@ Set level of input signal of original channel. Default is 0.8. @section surround Apply audio surround upmix filter. -This filter allows to produce multichannel output from stereo audio stream. +This filter allows to produce multichannel output from audio stream. The filter accepts the following options: @@ -3806,6 +3806,12 @@ Set output channel layout. By default, this is @var{5.1}. See @ref{channel layout syntax,,the Channel Layout section in the ffmpeg-utils(1) manual,ffmpeg-utils} for the required syntax. +@item chl_in +Set input channel layout. By default, this is @var{stereo}. + +See @ref{channel layout syntax,,the Channel Layout section in the ffmpeg-utils(1) manual,ffmpeg-utils} +for the required syntax. + @item level_in Set input volume level. By default, this is @var{1}. diff --git a/libavfilter/af_surround.c b/libavfilter/af_surround.c index c7d86a5..ee5e601 100644 --- a/libavfilter/af_surround.c +++ b/libavfilter/af_surround.c @@ -30,6 +30,7 @@ typedef struct AudioSurroundContext { const AVClass *class; char *out_channel_layout_str; + char *in_channel_layout_str; float level_in; float level_out; int output_lfe; @@ -40,6 +41,7 @@ typedef struct AudioSurroundContext { float highcut; uint64_t out_channel_layout; + uint64_t in_channel_layout; int nb_in_channels; int nb_out_channels; @@ -55,6 +57,7 @@ typedef struct AudioSurroundContext { int64_t pts; + void (*filter)(AVFilterContext *ctx); void (*upmix)(AVFilterContext *ctx, float l_phase, float r_phase, @@ -62,6 +65,14 @@ typedef struct AudioSurroundContext { float mag_total, float x, float y, int n); + void (*upmix_surround)(AVFilterContext *ctx, + float l_phase, + float r_phase, + float c_mag, + float c_phase, + float mag_total, + float x, float y, + int n); } AudioSurroundContext; static int query_formats(AVFilterContext *ctx) @@ -88,7 +99,7 @@ static int query_formats(AVFilterContext *ctx) return ret; layouts = NULL; - ret = ff_add_channel_layout(&layouts, AV_CH_LAYOUT_STEREO); + ret = ff_add_channel_layout(&layouts, s->in_channel_layout); if (ret) return ret; @@ -313,6 +324,41 @@ static void upmix_3_1(AVFilterContext *ctx, dstlfe[2 * n + 1] = lfe_mag * sinf(c_phase); } +static void upmix_3_1_surround(AVFilterContext *ctx, + float l_phase, + float r_phase, + float c_phase, + float c_mag, + float mag_total, + float x, float y, + int n) +{ + AudioSurroundContext *s = ctx->priv; + float lfe_mag, l_mag, r_mag, *dstc, *dstl, *dstr, *dstlfe; + + dstl = (float *)s->output->extended_data[0]; + dstr = (float *)s->output->extended_data[1]; + dstc = (float *)s->output->extended_data[2]; + dstlfe = (float *)s->output->extended_data[3]; + + get_lfe(s->output_lfe, n, s->lowcut, s->highcut, &lfe_mag, &c_mag); + + l_mag = sqrtf(.5f * ( x + 1.f)) * ((y + 1.f) * .5f) * mag_total; + r_mag = sqrtf(.5f * (-x + 1.f)) * ((y + 1.f) * .5f) * mag_total; + + dstl[2 * n ] = l_mag * cosf(l_phase); + dstl[2 * n + 1] = l_mag * sinf(l_phase); + + dstr[2 * n ] = r_mag * cosf(r_phase); + dstr[2 * n + 1] = r_mag * sinf(r_phase); + + dstc[2 * n ] = c_mag * cosf(c_phase); + dstc[2 * n + 1] = c_mag * sinf(c_phase); + + dstlfe[2 * n ] = lfe_mag * cosf(c_phase); + dstlfe[2 * n + 1] = lfe_mag * sinf(c_phase); +} + static void upmix_4_0(AVFilterContext *ctx, float l_phase, float r_phase, @@ -471,6 +517,52 @@ static void upmix_5_1_back(AVFilterContext *ctx, dstrs[2 * n + 1] = rs_mag * sinf(r_phase); } +static void upmix_5_1_back_surround(AVFilterContext *ctx, + float l_phase, + float r_phase, + float c_phase, + float c_mag, + float mag_total, + float x, float y, + int n) +{ + AudioSurroundContext *s = ctx->priv; + float lfe_mag, l_mag, r_mag, *dstc, *dstl, *dstr, *dstlfe; + float ls_mag, rs_mag, *dstls, *dstrs; + + dstl = (float *)s->output->extended_data[0]; + dstr = (float *)s->output->extended_data[1]; + dstc = (float *)s->output->extended_data[2]; + dstlfe = (float *)s->output->extended_data[3]; + dstls = (float *)s->output->extended_data[4]; + dstrs = (float *)s->output->extended_data[5]; + + get_lfe(s->output_lfe, n, s->lowcut, s->highcut, &lfe_mag, &c_mag); + + l_mag = sqrtf(.5f * ( x + 1.f)) * ((y + 1.f) * .5f) * mag_total; + r_mag = sqrtf(.5f * (-x + 1.f)) * ((y + 1.f) * .5f) * mag_total; + ls_mag = sqrtf(.5f * ( x + 1.f)) * (1.f - ((y + 1.f) * .5f)) * mag_total; + rs_mag = sqrtf(.5f * (-x + 1.f)) * (1.f - ((y + 1.f) * .5f)) * mag_total; + + dstl[2 * n ] = l_mag * cosf(l_phase); + dstl[2 * n + 1] = l_mag * sinf(l_phase); + + dstr[2 * n ] = r_mag * cosf(r_phase); + dstr[2 * n + 1] = r_mag * sinf(r_phase); + + dstc[2 * n ] = c_mag * cosf(c_phase); + dstc[2 * n + 1] = c_mag * sinf(c_phase); + + dstlfe[2 * n ] = lfe_mag * cosf(c_phase); + dstlfe[2 * n + 1] = lfe_mag * sinf(c_phase); + + dstls[2 * n ] = ls_mag * cosf(l_phase); + dstls[2 * n + 1] = ls_mag * sinf(l_phase); + + dstrs[2 * n ] = rs_mag * cosf(r_phase); + dstrs[2 * n + 1] = rs_mag * sinf(r_phase); +} + static void upmix_7_0(AVFilterContext *ctx, float l_phase, float r_phase, @@ -577,6 +669,71 @@ static void upmix_7_1(AVFilterContext *ctx, dstrs[2 * n + 1] = rs_mag * sinf(r_phase); } +static void filter_stereo(AVFilterContext *ctx) +{ + AudioSurroundContext *s = ctx->priv; + float *srcl, *srcr; + int n; + + srcl = (float *)s->input->extended_data[0]; + srcr = (float *)s->input->extended_data[1]; + + for (n = 0; n < s->buf_size; n++) { + float l_re = srcl[2 * n], r_re = srcr[2 * n]; + float l_im = srcl[2 * n + 1], r_im = srcr[2 * n + 1]; + float c_phase = atan2f(l_im + r_im, l_re + r_re); + float l_mag = hypotf(l_re, l_im); + float r_mag = hypotf(r_re, r_im); + float l_phase = atan2f(l_im, l_re); + float r_phase = atan2f(r_im, r_re); + float phase_dif = fabsf(l_phase - r_phase); + float mag_dif = (l_mag - r_mag) / (l_mag + r_mag); + float mag_total = hypotf(l_mag, r_mag); + float x, y; + + if (phase_dif > M_PI) + phase_dif = 2 * M_PI - phase_dif; + + stereo_position(mag_dif, phase_dif, &x, &y); + + s->upmix(ctx, l_phase, r_phase, c_phase, mag_total, x, y, n); + } +} + +static void filter_surround(AVFilterContext *ctx) +{ + AudioSurroundContext *s = ctx->priv; + float *srcl, *srcr, *srcc; + int n; + + srcl = (float *)s->input->extended_data[0]; + srcr = (float *)s->input->extended_data[1]; + srcc = (float *)s->input->extended_data[2]; + + for (n = 0; n < s->buf_size; n++) { + float l_re = srcl[2 * n], r_re = srcr[2 * n]; + float l_im = srcl[2 * n + 1], r_im = srcr[2 * n + 1]; + float c_re = srcc[2 * n], c_im = srcc[2 * n + 1]; + float c_mag = hypotf(c_re, c_im); + float c_phase = atan2f(c_im, c_re); + float l_mag = hypotf(l_re, l_im); + float r_mag = hypotf(r_re, r_im); + float l_phase = atan2f(l_im, l_re); + float r_phase = atan2f(r_im, r_re); + float phase_dif = fabsf(l_phase - r_phase); + float mag_dif = (l_mag - r_mag) / (l_mag + r_mag); + float mag_total = hypotf(l_mag, r_mag); + float x, y; + + if (phase_dif > M_PI) + phase_dif = 2 * M_PI - phase_dif; + + stereo_position(mag_dif, phase_dif, &x, &y); + + s->upmix_surround(ctx, l_phase, r_phase, c_phase, c_mag, mag_total, x, y, n); + } +} + static int init(AVFilterContext *ctx) { AudioSurroundContext *s = ctx->priv; @@ -584,54 +741,84 @@ static int init(AVFilterContext *ctx) int i; if (!(s->out_channel_layout = av_get_channel_layout(s->out_channel_layout_str))) { - av_log(ctx, AV_LOG_ERROR, "Error parsing channel layout '%s'.\n", + av_log(ctx, AV_LOG_ERROR, "Error parsing output channel layout '%s'.\n", s->out_channel_layout_str); return AVERROR(EINVAL); } + if (!(s->in_channel_layout = av_get_channel_layout(s->in_channel_layout_str))) { + av_log(ctx, AV_LOG_ERROR, "Error parsing input channel layout '%s'.\n", + s->in_channel_layout_str); + return AVERROR(EINVAL); + } + if (s->lowcutf >= s->highcutf) { av_log(ctx, AV_LOG_ERROR, "Low cut-off '%d' should be less than high cut-off '%d'.\n", s->lowcutf, s->highcutf); return AVERROR(EINVAL); } - switch (s->out_channel_layout) { - case AV_CH_LAYOUT_MONO: - s->upmix = upmix_1_0; - break; + switch (s->in_channel_layout) { case AV_CH_LAYOUT_STEREO: - s->upmix = upmix_stereo; - break; - case AV_CH_LAYOUT_2POINT1: - s->upmix = upmix_2_1; + s->filter = filter_stereo; + switch (s->out_channel_layout) { + case AV_CH_LAYOUT_MONO: + s->upmix = upmix_1_0; + break; + case AV_CH_LAYOUT_STEREO: + s->upmix = upmix_stereo; + break; + case AV_CH_LAYOUT_2POINT1: + s->upmix = upmix_2_1; + break; + case AV_CH_LAYOUT_SURROUND: + s->upmix = upmix_3_0; + break; + case AV_CH_LAYOUT_3POINT1: + s->upmix = upmix_3_1; + break; + case AV_CH_LAYOUT_4POINT0: + s->upmix = upmix_4_0; + break; + case AV_CH_LAYOUT_4POINT1: + s->upmix = upmix_4_1; + break; + case AV_CH_LAYOUT_5POINT0_BACK: + s->upmix = upmix_5_0_back; + break; + case AV_CH_LAYOUT_5POINT1_BACK: + s->upmix = upmix_5_1_back; + break; + case AV_CH_LAYOUT_7POINT0: + s->upmix = upmix_7_0; + break; + case AV_CH_LAYOUT_7POINT1: + s->upmix = upmix_7_1; + break; + default: + av_log(ctx, AV_LOG_ERROR, "Unsupported output channel layout '%s'.\n", + s->out_channel_layout_str); + return AVERROR(EINVAL); + } break; case AV_CH_LAYOUT_SURROUND: - s->upmix = upmix_3_0; - break; - case AV_CH_LAYOUT_3POINT1: - s->upmix = upmix_3_1; - break; - case AV_CH_LAYOUT_4POINT0: - s->upmix = upmix_4_0; - break; - case AV_CH_LAYOUT_4POINT1: - s->upmix = upmix_4_1; - break; - case AV_CH_LAYOUT_5POINT0_BACK: - s->upmix = upmix_5_0_back; - break; - case AV_CH_LAYOUT_5POINT1_BACK: - s->upmix = upmix_5_1_back; - break; - case AV_CH_LAYOUT_7POINT0: - s->upmix = upmix_7_0; - break; - case AV_CH_LAYOUT_7POINT1: - s->upmix = upmix_7_1; + s->filter = filter_surround; + switch (s->out_channel_layout) { + case AV_CH_LAYOUT_3POINT1: + s->upmix_surround = upmix_3_1_surround; + break; + case AV_CH_LAYOUT_5POINT1_BACK: + s->upmix_surround = upmix_5_1_back_surround; + break; + default: + av_log(ctx, AV_LOG_ERROR, "Unsupported output channel layout '%s'.\n", + s->out_channel_layout_str); + return AVERROR(EINVAL); + } break; default: - av_log(ctx, AV_LOG_ERROR, "Unsupported output channel layout '%s'.\n", - s->out_channel_layout_str); + av_log(ctx, AV_LOG_ERROR, "Unsupported input channel layout '%s'.\n", + s->in_channel_layout_str); return AVERROR(EINVAL); } @@ -714,9 +901,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) av_frame_free(&in); while (av_audio_fifo_size(s->fifo) >= s->buf_size) { - float *srcl, *srcr; AVFrame *out; - int n, ret; + int ret; ret = av_audio_fifo_peek(s->fifo, (void **)s->input->extended_data, s->buf_size); if (ret < 0) @@ -724,29 +910,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) ctx->internal->execute(ctx, fft_channel, NULL, NULL, inlink->channels); - srcl = (float *)s->input->extended_data[0]; - srcr = (float *)s->input->extended_data[1]; - - for (n = 0; n < s->buf_size; n++) { - float l_re = srcl[2 * n], r_re = srcr[2 * n]; - float l_im = srcl[2 * n + 1], r_im = srcr[2 * n + 1]; - float c_phase = atan2f(l_im + r_im, l_re + r_re); - float l_mag = hypotf(l_re, l_im); - float r_mag = hypotf(r_re, r_im); - float l_phase = atan2f(l_im, l_re); - float r_phase = atan2f(r_im, r_re); - float phase_dif = fabsf(l_phase - r_phase); - float mag_dif = (l_mag - r_mag) / (l_mag + r_mag); - float mag_total = hypotf(l_mag, r_mag); - float x, y; - - if (phase_dif > M_PI) - phase_dif = 2 * M_PI - phase_dif; - - stereo_position(mag_dif, phase_dif, &x, &y); - - s->upmix(ctx, l_phase, r_phase, c_phase, mag_total, x, y, n); - } + s->filter(ctx); out = ff_get_audio_buffer(outlink, s->hop_size); if (!out) @@ -792,6 +956,7 @@ static av_cold void uninit(AVFilterContext *ctx) static const AVOption surround_options[] = { { "chl_out", "set output channel layout", OFFSET(out_channel_layout_str), AV_OPT_TYPE_STRING, {.str="5.1"}, 0, 0, FLAGS }, + { "chl_in", "set input channel layout", OFFSET(in_channel_layout_str), AV_OPT_TYPE_STRING, {.str="stereo"},0, 0, FLAGS }, { "level_in", "set input level", OFFSET(level_in), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, { "level_out", "set output level", OFFSET(level_out), AV_OPT_TYPE_FLOAT, {.dbl=1}, 0, 10, FLAGS }, { "lfe", "output LFE", OFFSET(output_lfe), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },