From patchwork Sun Jul 30 22:11:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 43029 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7927:b0:130:ccc6:6c4b with SMTP id b39csp2030209pzg; Sun, 30 Jul 2023 15:11:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlEMQTJ4egTNa2SIqsVvTigTr5l15wnLePPm6IQm2/sYx0Wn0MI0apDUzM/4im1qvh2spz6O X-Received: by 2002:a2e:8197:0:b0:2b6:f1d5:619 with SMTP id e23-20020a2e8197000000b002b6f1d50619mr5338545ljg.14.1690755105400; Sun, 30 Jul 2023 15:11:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690755105; cv=none; d=google.com; s=arc-20160816; b=tcUcO4lpYzWTOAyHbtnfjAWD4AWHtcLyf7ba//ddjFMfshUtkmE5FJ3RDOCVMs3TZ8 Hp4+kQJPaus+0pZ/C/xE61+7zO3pJnKcGcBo6fGncrGZavkC4WwMs6gpueqdD3zQYMPm 3oQAwKpbOvbZnVEf5vSa7QZ+gp7fd9W6lCtegFhkSvtXiLrIkn5rf0LwjBoxnW7mHprk VOqFyrVqPmRKYWdEMbbcwr8UYHzt0jtJ3Tdb+Ye/uAhfyoA6TI3cYOkI+NdPZYYmHX8F 57zFK5m2DJsLU2WDKZIuTyftyBUSh6BTP9OXl0WpEPlizppaANn7jc4G8k2pBLtcaZGs lIbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=M8an8BCVTOk/JYLC1aJgmZYV9lGy3uWQaFCDkjZ1P2o=; fh=YYwLYmpaV0Fpw/rxmSKNRLS2XzDkAlGbHATiKOPtZrY=; b=pg+Ln3if1LNdWxj1+Dv/qEp3+fZTU8iqRu4B5gDnwCqKSAjHX0QA05CVqD2Bq5osm4 nwqEREuwdiIEljj3GlcdgWvxBCHnHoXsNAGXm3EP+DnboX2lDN4It9RgOfe6UwonpMNw nTNyrlJePHj02euDyMf9eNswKF5+3qjw1YlQqEdUO/hfwtHgG0hwAajRhQ3H7JfM9zvH V7HD974Dp4jfDBH6GTMwrBYcv6XXpm6ZynX03gMDXAo+asfDGigA6d5ZmlAjX0BK/c8j S+EmT/N4BZS2TBa/vTSm37VjicNDtS8Pb83Ptkyarc3YYfIPXpBGahzItJTYMUFoBA04 DO6A== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id b12-20020a170906038c00b0099325564b77si5044353eja.548.2023.07.30.15.11.44; Sun, 30 Jul 2023 15:11:45 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 639E868C543; Mon, 31 Jul 2023 01:11:40 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 70EC268C36E for ; Mon, 31 Jul 2023 01:11:34 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 66A2C40003 for ; Sun, 30 Jul 2023 22:11:33 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 31 Jul 2023 00:11:20 +0200 Message-Id: <20230730221131.1205193-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 01/12] avradio/avformat/sdrdemux: Move agc_gain into local variable X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: Z3jcTeGP09++ Signed-off-by: Michael Niedermayer --- libavformat/sdr.h | 1 - libavformat/sdrdemux.c | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libavformat/sdr.h b/libavformat/sdr.h index 77278ada67..1f2d3a49ab 100644 --- a/libavformat/sdr.h +++ b/libavformat/sdr.h @@ -161,7 +161,6 @@ typedef struct SDRContext { float agc_max_headroom; float agc_max_headroom_time; int agc_low_time; - float agc_gain; ///< current gain, should be accessed only by buffer thread after init atomic_int wanted_gain; int sdr_adcc; int64_t bandwidth; diff --git a/libavformat/sdrdemux.c b/libavformat/sdrdemux.c index 0dc89041c5..4bde431e17 100644 --- a/libavformat/sdrdemux.c +++ b/libavformat/sdrdemux.c @@ -1475,6 +1475,7 @@ static void *soapy_needs_bigger_buffers_worker(SDRContext *sdr) unsigned block_counter = 0; int64_t local_wanted_freq = 0; int64_t last_wanted_freq = 0; + float agc_gain = 0; sdr->remaining_file_block_size = 0; @@ -1529,16 +1530,16 @@ static void *soapy_needs_bigger_buffers_worker(SDRContext *sdr) block_counter = 0; // we just changed the frequency, do not trust the next blocks content } if (sdr->sdr_gain == GAIN_SW_AGC && - fabs(wanted_gain - sdr->agc_gain) > 0.001 && + fabs(wanted_gain - agc_gain) > 0.001 && sdr->set_gain_callback ) { sdr->set_gain_callback(sdr, wanted_gain); - sdr->agc_gain = wanted_gain; + agc_gain = wanted_gain; } pthread_mutex_unlock(&sdr->mutex); fifo_element.center_frequency = block_counter > 0 ? sdr->freq : 0; - fifo_element.gain = sdr->agc_gain; //we make only small changes so slightly mixing should be ok + fifo_element.gain = agc_gain; //we make only small changes so slightly mixing should be ok remaining = sdr->block_size; while (remaining && !atomic_load(&sdr->close_requested)) { From patchwork Sun Jul 30 22:11:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 43030 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7927:b0:130:ccc6:6c4b with SMTP id b39csp2030292pzg; Sun, 30 Jul 2023 15:11:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlHw3VqNaCgMtMDj6Aj0sJqw/pPQadPvPefGZFIgXmXzo8gJt73ySfqvKOloJyoPMf1CNJ3H X-Received: by 2002:a17:906:8457:b0:99b:cd1a:a453 with SMTP id e23-20020a170906845700b0099bcd1aa453mr6383837ejy.3.1690755117717; Sun, 30 Jul 2023 15:11:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690755117; cv=none; d=google.com; s=arc-20160816; b=McZIe/eFd0kIvexpqHjRG3f21BDhilV+rkciQyJWazg828qxxf9ST4Dmo0u0+ZmZtb TwBJUYMLBvE87FI1tBQGNbsNSmiFTrs/F3wxYur1jy2FXTD3FQdwGB4pLcEvLSBLt7Wd yVfaiObC4LrHtusGhaPw0GfYZlZTukP6UW5DpxVVGX6SBb3OTBCZYrzEoOZ0QPelY3xd nl5xYMOjDPKaQNcla6DWdPx1iUOyAzYGiyGaK43f/R9zM5lbwYlaJ3NDDculqbkPfI2O gqm4QcmcBmlV5wqYRFK39HRvKSlH0FOUDxRcUM5Um3A5zAkovM94Ag2izAh1b4pq8CZd FuRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=savoN4hpEelAoRg9tGEM0yMX0Qh/eCSKFNaGiB0A98A=; fh=YYwLYmpaV0Fpw/rxmSKNRLS2XzDkAlGbHATiKOPtZrY=; b=WbYbcG3eWa0GgMEuVFeXhlv+WZcEbWm4J9n086dctrQQJvOGGcVitht0hTCiVUhAVk tiMQ69HTjQF1aqWQi/hDVodbYerKkIM2Wd1S+IYvkTrujmUCyERcix97dFdzgmiAuGqx y9JHDSt6fB2wWzKzjA7Wt8uHrOTAvvBduCj6Mz3zJmfq+VSAGQnyGP6fEOHAi7JQwcKf tBCuCUFhG3uRZ5KxOAHSXya04gyK3VMThUUo4aFXfIxuOprxSJKgLsJ6PI7LyEpTI0Ux R2E7NiZi1cTH73kNP37W0pUpkx56XrRb7kQfCw1lXyfNLShttPZoz4BPM11sAFIk19J2 qLKQ== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id w6-20020a1709064a0600b0098e2aa0bb92si6070253eju.137.2023.07.30.15.11.57; Sun, 30 Jul 2023 15:11:57 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 966AC68C36E; Mon, 31 Jul 2023 01:11:43 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B352368C548 for ; Mon, 31 Jul 2023 01:11:35 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id CDEAB1C0002 for ; Sun, 30 Jul 2023 22:11:34 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 31 Jul 2023 00:11:21 +0200 Message-Id: <20230730221131.1205193-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230730221131.1205193-1-michael@niedermayer.cc> References: <20230730221131.1205193-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 02/12] avradio/avformat/sdrdemux: Move Software AGC into buffer thread X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: B5wXE+wb9sH9 This allows the AGC to act with less latency Signed-off-by: Michael Niedermayer --- libavformat/sdr.h | 1 - libavformat/sdrdemux.c | 77 ++++++++++++++++++++++++------------------ 2 files changed, 44 insertions(+), 34 deletions(-) diff --git a/libavformat/sdr.h b/libavformat/sdr.h index 1f2d3a49ab..1bf8fbef79 100644 --- a/libavformat/sdr.h +++ b/libavformat/sdr.h @@ -161,7 +161,6 @@ typedef struct SDRContext { float agc_max_headroom; float agc_max_headroom_time; int agc_low_time; - atomic_int wanted_gain; int sdr_adcc; int64_t bandwidth; int64_t last_pts; diff --git a/libavformat/sdrdemux.c b/libavformat/sdrdemux.c index 4bde431e17..e5ee4e80f5 100644 --- a/libavformat/sdrdemux.c +++ b/libavformat/sdrdemux.c @@ -1475,6 +1475,7 @@ static void *soapy_needs_bigger_buffers_worker(SDRContext *sdr) unsigned block_counter = 0; int64_t local_wanted_freq = 0; int64_t last_wanted_freq = 0; + float wanted_gain = (sdr->min_gain + sdr->max_gain) / 2; float agc_gain = 0; sdr->remaining_file_block_size = 0; @@ -1485,7 +1486,6 @@ static void *soapy_needs_bigger_buffers_worker(SDRContext *sdr) FIFOElement fifo_element; int remaining, ret; int empty_blocks, full_blocks; - float wanted_gain = atomic_load(&sdr->wanted_gain) / 65536.0; int64_t wanted_freq = atomic_load(&sdr->wanted_freq); int seek_direction = atomic_load(&sdr->seek_direction); @@ -1551,6 +1551,49 @@ static void *soapy_needs_bigger_buffers_worker(SDRContext *sdr) remaining -= ret; } + if (sdr->sdr_gain == GAIN_SW_AGC) { + float inmax = 0; + int inmax1 = 0; + // We only check 25% of the data to safe computations + int start = 3*sdr->block_size / 4; + int end = 5*sdr->block_size / 4; + if (sdr->sample_size == 2) { + const int8_t *halfblock = fifo_element.halfblock; + for (int i = start; i < end; i++) { + int v = FFMAX(FFABS(halfblock[i]), FFABS(halfblock[i])); + inmax1 = FFMAX(inmax1, v); + } + } else if (sdr->sample_size == 4) { + const int16_t *halfblock = fifo_element.halfblock; + for (int i = start; i < end; i++) { + int v = FFMAX(FFABS(halfblock[i]), FFABS(halfblock[i])); + inmax1 = FFMAX(inmax1, v); + } + } else { + const float *halfblock = fifo_element.halfblock; + for (int i = start; i < end; i++) { + float v = fmaxf(fabsf(halfblock[i]), fabsf(halfblock[i])); + inmax = fmaxf(inmax, v); + } + } + inmax = fmaxf(inmax, inmax1 / sdr->sample_scale); + + if (inmax > 1.0 - sdr->agc_min_headroom && wanted_gain > sdr->min_gain) { + //according to docs this is a dB scale, in reality it beheaves differnt to that + //Because of this we will try to just make small changes and not assume too much + wanted_gain = FFMIN(wanted_gain, FFMAX(agc_gain - 1.0, agc_gain * 0.9)); + + sdr->agc_low_time = 0; + } else if (inmax < 1.0 - sdr->agc_max_headroom && wanted_gain < sdr->max_gain) { + sdr->agc_low_time += sdr->block_size; + if (sdr->agc_low_time > sdr->agc_max_headroom_time * sdr->sdr_sample_rate) { + sdr->agc_low_time = 0; + wanted_gain = FFMAX(wanted_gain, FFMIN(agc_gain + 1.0, agc_gain * 1.1)); + } + } else + sdr->agc_low_time = 0; + } + inject_block_into_fifo(sdr, sdr->full_block_fifo, &fifo_element, "block fifo overflow, discarding block\n"); } av_assert0(atomic_load(&sdr->close_requested) == 1); @@ -1724,7 +1767,6 @@ int avpriv_sdr_common_init(AVFormatContext *s) atomic_init(&sdr->close_requested, 0); atomic_init(&sdr->seek_direction, 0); atomic_init(&sdr->wanted_freq, sdr->user_wanted_freq); - atomic_init(&sdr->wanted_gain, lrint((sdr->min_gain + sdr->max_gain) * 65536 / 2)); ret = pthread_mutex_init(&sdr->mutex, NULL); if (ret) { av_log(s, AV_LOG_ERROR, "pthread_mutex_init failed: %s\n", strerror(ret)); @@ -2021,37 +2063,6 @@ process_next_block: } } - float smaller_block_gain = FFMIN(fifo_element[0].gain, fifo_element[1].gain); - float bigger_block_gain = FFMAX(fifo_element[0].gain, fifo_element[1].gain); - - if (sdr->sdr_gain == GAIN_SW_AGC) { - float inmax = 0; - float wanted_gain = atomic_load(&sdr->wanted_gain) / 65536.0; - // We only check 25% of the data to safe computations - int start = 3*sdr->block_size / 4; - int end = 5*sdr->block_size / 4; - for (i = start; i < end; i++) { - float v = fmaxf(fabsf(sdr->windowed_block[i].re), fabsf(sdr->windowed_block[i].im)); - inmax = fmaxf(inmax, v); - } - - if (inmax > 1.0 - sdr->agc_min_headroom && wanted_gain > sdr->min_gain) { - //according to docs this is a dB scale, in reality it beheaves differnt to that - //Because of this we will try to just make small changes and not assume too much - wanted_gain = FFMIN(wanted_gain, FFMAX(smaller_block_gain - 1.0, smaller_block_gain * 0.9)); - - sdr->agc_low_time = 0; - } else if (inmax < 1.0 - sdr->agc_max_headroom && wanted_gain < sdr->max_gain) { - sdr->agc_low_time += sdr->block_size; - if (sdr->agc_low_time > sdr->agc_max_headroom_time * sdr->sdr_sample_rate) { - sdr->agc_low_time = 0; - wanted_gain = FFMAX(wanted_gain, FFMIN(bigger_block_gain + 1.0, bigger_block_gain * 1.1)); - } - } else - sdr->agc_low_time = 0; - atomic_store(&sdr->wanted_gain, (int)lrint(wanted_gain * 65536)); - } - inject_block_into_fifo(sdr, sdr->empty_block_fifo, &fifo_element[0], "Cannot pass next buffer, freeing it\n"); #ifdef SYN_TEST //synthetic test signal static int64_t synp=0; From patchwork Sun Jul 30 22:11:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 43031 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7927:b0:130:ccc6:6c4b with SMTP id b39csp2030356pzg; Sun, 30 Jul 2023 15:12:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlEG+0QVpgTL6C8IOHyij4jAr3cQPNtJFpSUoT+dt4HqoLD30+1/mOo54jO0pUvbZcziAAre X-Received: by 2002:a2e:88ce:0:b0:2b6:df6b:84c0 with SMTP id a14-20020a2e88ce000000b002b6df6b84c0mr5408419ljk.25.1690755127629; Sun, 30 Jul 2023 15:12:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690755127; cv=none; d=google.com; s=arc-20160816; b=1J9CNpNDdX+VhLiQmj4xq6fVakLNjZlC60bUWwMK9Ct5npIjalkYgHOCpBG5vihXaw /pqF5kQWVseJJq36Cb1XfqOjsDdWuEHhhNCpvCwONG4PDMxKGINHbs2qYDXpsNSoAXIm LZ7oOGjuFGsWdsZo01o0f7gEQrS2j3PNnjZ0HIEmMuQz06+swNg4vAoXT6b15/zoyRDy I/5Pof5oJ0olSJT22KGfdtKSxcXdVPWp7rHys8r0gO4vYhEX64dnMenZWSEBZknsMfQ8 44dpy3DW7C/Pyh0RqCGDU6QoJinBQBY00v4ynOaIjO7sR2rvK38X/UlNSFhCBfYZr19B Wzlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=uxkBjmg1yY3XnIWU1ZCXFu+VYJpTVWxPyeOxCsyYDtU=; fh=YYwLYmpaV0Fpw/rxmSKNRLS2XzDkAlGbHATiKOPtZrY=; b=BCOAotJnK2v7B7MLMQNWDhtQGvt8kEMugxlzubNl3qeFDx/ynKiKL0XGhQFDz1nqLu dWlbaHGWJcZFDOjhtbKfTYGmjetKFx3ALuqrUmnAmskbyuQX6Cn3yo/wQEvV80IXAbGV mgf5jJRIvxbwa11ALuGGQOpn46k5D3w/rzM2gj2QcifStIjiPdq0ygh+zYVdICAexAqh G4dsFhrAP4K3aguErpIPbWQFAzpsWs2DzKCFW2pK9x8Lq1m24xxcbqqjDowMiRAbPbc3 TvaJa7F+tIz/FDk7Bpg5gtFblQLv0d0LAyix6MDPmzUqhBS0DMTSemec2m87zxLlwONd 24mw== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id t25-20020a1709066bd900b00991dfb5dfbdsi6092466ejs.203.2023.07.30.15.12.07; Sun, 30 Jul 2023 15:12:07 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AEC6268C551; Mon, 31 Jul 2023 01:11:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EEB9B68C36E for ; Mon, 31 Jul 2023 01:11:36 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 1E605240004 for ; Sun, 30 Jul 2023 22:11:35 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 31 Jul 2023 00:11:22 +0200 Message-Id: <20230730221131.1205193-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230730221131.1205193-1-michael@niedermayer.cc> References: <20230730221131.1205193-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 03/12] avradio/avdevice/sdrindev: Soapy / RTLSDR ignores gain in direct sampling mode X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: aQcFjHNwGTWt Signed-off-by: Michael Niedermayer --- libavdevice/sdrindev.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavdevice/sdrindev.c b/libavdevice/sdrindev.c index f07bd6b154..8766fc2f34 100644 --- a/libavdevice/sdrindev.c +++ b/libavdevice/sdrindev.c @@ -88,6 +88,10 @@ static int sdrindev_set_gain_callback(SDRContext *sdr, float gain) } if (sdr->sdr_gain != GAIN_SDR_AGC) { + if (sdr->current_direct_samp && !strcmp(sdr->current_direct_samp, "2")) { + return -1; // soapy ignores gain in direct sampling mode + } + ret = SoapySDRDevice_setGain(soapy, SOAPY_SDR_RX, 0, gain); if (ret) { av_log(avfmt, AV_LOG_WARNING, "Failed to set gain to %f (%s)\n", gain, SoapySDRDevice_lastError()); From patchwork Sun Jul 30 22:11:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 43032 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7927:b0:130:ccc6:6c4b with SMTP id b39csp2030409pzg; Sun, 30 Jul 2023 15:12:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlHmW5F8NtwwpbpT5+58H3AFqFFGhWcwbKSvB0NK64VMIAruw+6nvVercau5kRmDMTBj2AuO X-Received: by 2002:a17:906:dc:b0:99c:47a:8bd5 with SMTP id 28-20020a17090600dc00b0099c047a8bd5mr3530974eji.65.1690755136895; Sun, 30 Jul 2023 15:12:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690755136; cv=none; d=google.com; s=arc-20160816; b=kUL37R8HLsyaHbX1EfCpb3gqTq3jTIjsx/Vbt2Q82tdWQhF438LORImDeK7TzwK6Vz dzY5/RAj2KPpJ0WJOcsmBif2wZpWVsBTBV5EDmlqDtgw30lUbi0Qszq4eUYdw/0SULR/ IhOCUhipTI/GQB4yg5IMhQbnAzmCRUdM4Bl0IxLYDCLeJ4xWkRdT7YEPFBkLESDIvBH3 UYI5sy2LAkqonJ0X+zDRAF/eyuM1egeJbHmHlQMQp3ie5m797KXR+HBvHsOeoKF/ttdV OaA23HLRYHXv0utC4DQnHb7wBj0mAklIRBILwsBk8dHoEizUmc/OWj7Ru1o84Jh06fmq qfAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=MKcsoSuhYo6zM3koEe1Lj02oZbNr/0n6nGVgXsks26A=; fh=YYwLYmpaV0Fpw/rxmSKNRLS2XzDkAlGbHATiKOPtZrY=; b=JSb0E6gwxgSGJHG0ljc9AqxBVop5fpVd54IUUOzYplqNZMDNU01o1AaE/1ppdi+kov Rs59fFzZlBvqAaO6zSbUwznBmkzQF3DGnHRdaq1EIGkOeeqNv7qbVF1zFw7VI/+bDmqh 3V4gvkyBFHpId2oFCgITrMH3yZTGT46IyXAl84zMEMRd5y6La3s+JoCPMwXL2CO8jgwH OCrqTDfbp1IJRRmKeHhwDkobDdRuOxp8rukIA2uENIuy0sj8ukA7dG8lqpyHih9zQgFv TQZ39cLpw1LmxTmodysNcFVCtr8nYNMJt0M9WmNhVQvCPCQh2AudNfEpEEROrf/sy0mw RvLg== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id s23-20020a1709066c9700b0099bcb8f4f00si5965950ejr.409.2023.07.30.15.12.16; Sun, 30 Jul 2023 15:12:16 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CBDA468C54F; Mon, 31 Jul 2023 01:11:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7511568C554 for ; Mon, 31 Jul 2023 01:11:38 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9B521C0002 for ; Sun, 30 Jul 2023 22:11:37 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 31 Jul 2023 00:11:23 +0200 Message-Id: <20230730221131.1205193-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230730221131.1205193-1-michael@niedermayer.cc> References: <20230730221131.1205193-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 04/12] avradio/avformat/sdrdemux: only update agc_gain on success X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: Cti/gfHXCquK Signed-off-by: Michael Niedermayer --- libavformat/sdrdemux.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/sdrdemux.c b/libavformat/sdrdemux.c index e5ee4e80f5..fa45d30a3d 100644 --- a/libavformat/sdrdemux.c +++ b/libavformat/sdrdemux.c @@ -1533,8 +1533,10 @@ static void *soapy_needs_bigger_buffers_worker(SDRContext *sdr) fabs(wanted_gain - agc_gain) > 0.001 && sdr->set_gain_callback ) { - sdr->set_gain_callback(sdr, wanted_gain); - agc_gain = wanted_gain; + int ret = sdr->set_gain_callback(sdr, wanted_gain); + if (ret >= 0) { + agc_gain = wanted_gain; + } } pthread_mutex_unlock(&sdr->mutex); From patchwork Sun Jul 30 22:11:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 43033 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7927:b0:130:ccc6:6c4b with SMTP id b39csp2030465pzg; Sun, 30 Jul 2023 15:12:26 -0700 (PDT) X-Google-Smtp-Source: APBJJlGVsJ255qxwapar79BUt6F6A3q2P4s1dY0G/WoQKSEUSN3PXAjZPDHeLN1t8c4/hCkN3WL2 X-Received: by 2002:a17:906:20d0:b0:993:f497:adc2 with SMTP id c16-20020a17090620d000b00993f497adc2mr5383982ejc.18.1690755145894; Sun, 30 Jul 2023 15:12:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690755145; cv=none; d=google.com; s=arc-20160816; b=F/LQpF7EMlh6kNGitrcZOMVxlZIBa3JbUWsRFKQXBCdxblo+/a1YLhE6p4wgh56uV5 PezxEMnrUQoKZGwPxkj1zZIGM9vSNh2abGMJWAACtJvuKl17Vilx9E1PpROgUgKO/4c4 o4raJdVYKEnznXHiYZP9G+xm4ZQdL5Q/WlwNvfF2Zy6+HUecYXPxEeztsCtoxfipTM3b A+rOwClESYNGjj8anE13apo8FZr6db3LV9g7CBv/gylc9PCKgxQYpVYyffmupq4ku3WJ FXo4Y28Jb/gxRyxjh/e0uwLxUeQ3TophaCoYJjzHpWR3DScfmSNGb6eAOZ1CUv/dFTaC Ezlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=Cr8BpGNSoydWqARjeXKRvs3PD7Z7Y2Sb2YFU6ysRQBY=; fh=YYwLYmpaV0Fpw/rxmSKNRLS2XzDkAlGbHATiKOPtZrY=; b=r81y2VTWuygVLvJZ8bl0VBNS/kM2pWOa9f6nlyVncR8uPSHcsRMSJUA7Lvw4Yf9mn8 u3pRxHbE8NgzQtdwZXBu5CtATs2zjyZlTa5igzV1jDqoeEnKVQYvl54JQSfuiXnyFHSk 4KnXMKmmQkeXTzW50vsiW/bshcbpO8xbLG3M8OO9zkSvJmndm+eUV4iApFWK+noxjymp ZdQE82LPU4CKsdAE1eFzNQom2nmVkSuqEK4N2Zjveh0Y3ujE5+3eFnkwYqgbcvERtWPo 9lIHzsmDLtGa2wGb1/t1j6LnwqHV4p3wcU/eZmSDMaCSRlMbvbQ+PK0UJyMGk8ljGJX4 DGBQ== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f16-20020a1709067f9000b009893fe84e74si6199669ejr.484.2023.07.30.15.12.25; Sun, 30 Jul 2023 15:12:25 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C3E1968C55F; Mon, 31 Jul 2023 01:11:46 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C87C468C556 for ; Mon, 31 Jul 2023 01:11:39 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 046DC60002 for ; Sun, 30 Jul 2023 22:11:38 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 31 Jul 2023 00:11:24 +0200 Message-Id: <20230730221131.1205193-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230730221131.1205193-1-michael@niedermayer.cc> References: <20230730221131.1205193-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 05/12] avradio/avformat/sdrdemux: delay station search on AGC adjust X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: oNaA54qG0Gyc Signed-off-by: Michael Niedermayer --- libavformat/sdrdemux.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/sdrdemux.c b/libavformat/sdrdemux.c index fa45d30a3d..44a6489bd2 100644 --- a/libavformat/sdrdemux.c +++ b/libavformat/sdrdemux.c @@ -1536,6 +1536,8 @@ static void *soapy_needs_bigger_buffers_worker(SDRContext *sdr) int ret = sdr->set_gain_callback(sdr, wanted_gain); if (ret >= 0) { agc_gain = wanted_gain; + if (block_counter) + block_counter = 1; } } pthread_mutex_unlock(&sdr->mutex); From patchwork Sun Jul 30 22:11:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 43036 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7927:b0:130:ccc6:6c4b with SMTP id b39csp2030625pzg; Sun, 30 Jul 2023 15:12:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlHA3z9o4nCaa4wf4ijJclaTbtgPUarfSCs6PuwBCJMmdawYSPfGqUfZFT9bgj1wUkfbOORH X-Received: by 2002:a17:907:1dce:b0:969:7739:2eb7 with SMTP id og14-20020a1709071dce00b0096977392eb7mr5016433ejc.4.1690755173320; Sun, 30 Jul 2023 15:12:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690755173; cv=none; d=google.com; s=arc-20160816; b=KlTfGGTcH++Xy9JJFFj3z8Bg8Pyc2wme1TsCq6Tvbn9Vv72u8rpic7rYIQa+e2J/pf ZVrSlNE5mGm77cR1RlVvmzLV0QyHHM7coinbV68yNnWKqbfXFCJ3DWGu9dwKIrzZz2/S RLG1Hi/mszr+B9kstU5GlBrnUYRFgmAKbbgUi0Bc2n8hIijn6JOVse7jPegDWzklRhU7 dguY6VGsSxB0nHw1VF1CLI/3PXGWC3qDkgGyM81eT46Rvhcp6vUiusPOlA+vAHckmob7 sdNIqSN/pWpzF/XXCo1v9wetJv61yWEoO+xBsR8KcQzyRBFunvDGt8SC0GIMU4yHuidi OWrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=LoQGkur/R2qwvSUpZxcR+JdURTos+dFmImFpLurjCWQ=; fh=YYwLYmpaV0Fpw/rxmSKNRLS2XzDkAlGbHATiKOPtZrY=; b=fcDjv2qlR2o/MaUWJp56XfGX2IuTx24eR8akScfkyg+BPrwPzW3DtXwNYlB8pZqqCW cJrz+HgqrB9brIhHBix9/IRSfppH/LvXNH/nbk/3kZr6GOc6+VOJ0ANSz2kCAoAOfOnq +2H2yygTDN+1xIIwCCQRgju6v411hDQ2Hjb23MQrsSi8up4l7MsBNdMZ0cMYs86rDWlh wtoe3U7aH6fYXrW8VsbKQAwH5lgFtFmG2fSXxSJnTCmb/qFaitIpvGPB0tcLooQIq1Qd yUQD3iBGSs8ZgCzePpk7O+B67LlhWZ0AVTNg/u6swB4uob2p0HcR17y7jfk5iZ2phNjA QBLA== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id u7-20020a170906408700b00988713509c1si5951440ejj.895.2023.07.30.15.12.52; Sun, 30 Jul 2023 15:12:53 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 07BAD68C59F; Mon, 31 Jul 2023 01:11:51 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9B1D468C578 for ; Mon, 31 Jul 2023 01:11:41 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id BDEE8FF802 for ; Sun, 30 Jul 2023 22:11:40 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 31 Jul 2023 00:11:25 +0200 Message-Id: <20230730221131.1205193-6-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230730221131.1205193-1-michael@niedermayer.cc> References: <20230730221131.1205193-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 06/12] avradio/avformat/sdrdemux: run clip check on the correct samples X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: JABHPXE3RL/T Signed-off-by: Michael Niedermayer --- libavformat/sdrdemux.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libavformat/sdrdemux.c b/libavformat/sdrdemux.c index 44a6489bd2..69349add7b 100644 --- a/libavformat/sdrdemux.c +++ b/libavformat/sdrdemux.c @@ -1153,10 +1153,9 @@ static int demodulate_fm(SDRContext *sdr, Station *station, AVStream *st, AVPack sst->out_buf[2*i+0] = sst->out_buf[2*i+1] = m; } - - if (fabs(sst->out_buf[i]) > clip) { - av_log(sdr->avfmt, AV_LOG_WARNING, "CLIP %f\n", sst->out_buf[i]); - clip = fabs(sst->out_buf[i]) * 1.1; + if (fmax(fabs(sst->out_buf[2*i+0]), fabs(sst->out_buf[2*i+1])) > clip) { + av_log(sdr->avfmt, AV_LOG_WARNING, "CLIP %f %f\n", sst->out_buf[2*i+0], sst->out_buf[2*i+1]); + clip = fmax(fabs(sst->out_buf[2*i+0]), fabs(sst->out_buf[2*i+1])) * 1.1; } } From patchwork Sun Jul 30 22:11:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 43038 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7927:b0:130:ccc6:6c4b with SMTP id b39csp2030750pzg; Sun, 30 Jul 2023 15:13:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlHUHwBdcJq57A3yUBxV0zydJ5cyQOH5h78y4ocIXeWQx5OxR03h2xUASej/pipR4G2njuv/ X-Received: by 2002:a17:906:db0d:b0:98d:ebb7:a8b0 with SMTP id xj13-20020a170906db0d00b0098debb7a8b0mr5308802ejb.14.1690755190875; Sun, 30 Jul 2023 15:13:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690755190; cv=none; d=google.com; s=arc-20160816; b=Z8XORKbapXLxglhEt0HN3LP5CbmktG50J22SCinstqXWabpXql5REJ2HxwfV8Vh82h T0gklWNb69vxt0ItnJEoIfG2z+W+4+0V+7vdKt06F+rp3CRxRZqheJdoTr5+45nrcxwZ ouPOn8W/fHpoM22Rz6/2e2Jelt5yJc1agBROOsoTAizB8iGbBgMuqkP6pvxV3FstV33P sFJsoiJBNRnXy/BHaNyoOS/3QV3uttup4u9raR7szY12EpTUo0UbctfQ7no8M45+7vwq Rj0rWNvkGe6ma3CiZhT4sHF2QSDtx4b1llxUf+6Q43lTmND/xzTPlj6YATiiDoh1g6z1 0utw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=Q+b4s38fPGU/WaQdYVXicE/TI7QahuERdRHh+NNDO3Y=; fh=YYwLYmpaV0Fpw/rxmSKNRLS2XzDkAlGbHATiKOPtZrY=; b=x1G3Qwo4TQL3JFe7e6RitI3qZYpVa6YzMIKd1lvLET/y5Ek5/Zx3mHX8bOXrnr70MH vf61ZJZrWjALk38UCLx99Dz8U4KFLvjOV1YeaUO8GzmvG8LRX+t+DypNqYvMjhQEySzm vjz6LQzWGYXV4Yhq1JwQAZXDkTBjhUVzR3K8YflOrS7vTgXeA9Vx5lJXdLz6KsHWXJfc LQe3p/nNp8wr3NJCsB8AqAprkfGSfVwHVVVPzdhsb9b4XMp5AX04OSMWhyZd30NsGcer Jht2sY8vDYfIhxJZ/SpBW+DEFE+p4Al/Dgc1HADJc1JHG11B2UyIr1+ijBOdC271R79h KtEQ== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id va16-20020a17090711d000b0099290e2c162si6543903ejb.444.2023.07.30.15.13.10; Sun, 30 Jul 2023 15:13:10 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3B55D68BC6A; Mon, 31 Jul 2023 01:11:53 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 743F068C562 for ; Mon, 31 Jul 2023 01:11:43 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 95BEF1BF204 for ; Sun, 30 Jul 2023 22:11:42 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 31 Jul 2023 00:11:26 +0200 Message-Id: <20230730221131.1205193-7-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230730221131.1205193-1-michael@niedermayer.cc> References: <20230730221131.1205193-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 07/12] avradio/avformat/sdrdemux: Avoid uninitialized memory on mono -> stereo switch X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: Lq+i/LOJHRij Signed-off-by: Michael Niedermayer --- libavformat/sdrdemux.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/sdrdemux.c b/libavformat/sdrdemux.c index 69349add7b..8f0f4657f3 100644 --- a/libavformat/sdrdemux.c +++ b/libavformat/sdrdemux.c @@ -1150,6 +1150,8 @@ static int demodulate_fm(SDRContext *sdr, Station *station, AVStream *st, AVPack sst->out_buf[2*i+0] = m + q; sst->out_buf[2*i+1] = m - q; } else { + newbuf[2*i+1] = 0; + sst->out_buf[2*i+0] = sst->out_buf[2*i+1] = m; } From patchwork Sun Jul 30 22:11:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 43040 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7927:b0:130:ccc6:6c4b with SMTP id b39csp2030869pzg; Sun, 30 Jul 2023 15:13:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlHIrTcVQYm4Fk9pSlDUcw3ebfe/BhDHe4pAmWohIoVXPfRBC8ezEQ5cV5wiPuoFuMzFM6ts X-Received: by 2002:a17:906:73d8:b0:992:48b7:99e3 with SMTP id n24-20020a17090673d800b0099248b799e3mr5272344ejl.63.1690755210054; Sun, 30 Jul 2023 15:13:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690755210; cv=none; d=google.com; s=arc-20160816; b=kZYbsAR24yMQ/RfMMp8GCJ/BIPJGgEgBbQKax2UB2fvzNxzAG4tggnJFKQY+8NjYme 4vEoIfUBxOYmNRVHFU0Ec7N2FMJijtVmbEBti7DJW2RoIqP5lnQOwTescBy0s4XbCoiu rdwxvDsTJ1XNzi+ulGd5o+Uii91o5PV2mhYSMRW0JtkJg+SQCDPFcRUEqNroQskzFgvj HEJzM11XNxfiqBkaK4EjQHknZ/ZYhb8cIU9CNaA8XqiM+hSnmsx5EbOOSuJWomYkNFV1 +JKWapG8Txbi99FERh26yyKmE0hcwOwb08XQPewi4HYSzPpuSb3Tx4OivQ6FNBB8q+p8 VaKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=KcTiADvQ6Z26+n0TTRNvtSUk2QquQDVs1OKaPazbXuU=; fh=YYwLYmpaV0Fpw/rxmSKNRLS2XzDkAlGbHATiKOPtZrY=; b=lmy4D/t4BJToxbN97Rc8ce8pJrSgDASPi8gmEQ0BBWxyGxW+l0qIhr6bg3mswTLR7D rhIFDxwaprA/fcKAhOWYRIK6h3JClsrugVk217cfVEpmddLvE5ssd6Dr2c7+9JCymfCP BTHFXEQfzjiRNEjVnOdHJbHZcP3Jp3J3GWqZC+QC6iD3J83tlFzicDVobsgvsxqKMLQm OiD3qmhXz5kEgtttb6sPv+V8KmqXo5//fSsii5fMaiy+klJTv1aBEEXCOdCps7yO/jby UJxDS98JiKhMjpr0/zbH1fsiSv170VJxCwF/KvJ8+KoNLZ9pAuUJLqK7tSOJ3pBgUSfL 6pSA== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id q24-20020a17090622d800b00997bd42d213si6154927eja.165.2023.07.30.15.13.29; Sun, 30 Jul 2023 15:13:30 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5F3DF68C540; Mon, 31 Jul 2023 01:11:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5453368C5A0 for ; Mon, 31 Jul 2023 01:11:44 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id A913E40004 for ; Sun, 30 Jul 2023 22:11:43 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 31 Jul 2023 00:11:27 +0200 Message-Id: <20230730221131.1205193-8-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230730221131.1205193-1-michael@niedermayer.cc> References: <20230730221131.1205193-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 08/12] avradio/avformat/sdrdemux: set wanted gain also when manually set X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: XEGlsqej9caH Signed-off-by: Michael Niedermayer --- libavformat/sdrdemux.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/sdrdemux.c b/libavformat/sdrdemux.c index 8f0f4657f3..3f3390049c 100644 --- a/libavformat/sdrdemux.c +++ b/libavformat/sdrdemux.c @@ -1476,7 +1476,7 @@ static void *soapy_needs_bigger_buffers_worker(SDRContext *sdr) unsigned block_counter = 0; int64_t local_wanted_freq = 0; int64_t last_wanted_freq = 0; - float wanted_gain = (sdr->min_gain + sdr->max_gain) / 2; + float wanted_gain = sdr->sdr_gain < 0 ? (sdr->min_gain + sdr->max_gain) / 2 : sdr->sdr_gain; float agc_gain = 0; sdr->remaining_file_block_size = 0; @@ -1530,7 +1530,8 @@ static void *soapy_needs_bigger_buffers_worker(SDRContext *sdr) //And theres not much else we can do, an error message was already printed by ff_sdr_set_freq() in that case block_counter = 0; // we just changed the frequency, do not trust the next blocks content } - if (sdr->sdr_gain == GAIN_SW_AGC && + if (sdr->sdr_gain != GAIN_SDR_AGC && + sdr->sdr_gain != GAIN_DEFAULT && fabs(wanted_gain - agc_gain) > 0.001 && sdr->set_gain_callback ) { @@ -1539,6 +1540,7 @@ static void *soapy_needs_bigger_buffers_worker(SDRContext *sdr) agc_gain = wanted_gain; if (block_counter) block_counter = 1; + av_log(avfmt, AV_LOG_DEBUG, "GAIN changed %f\n", wanted_gain); } } pthread_mutex_unlock(&sdr->mutex); From patchwork Sun Jul 30 22:11:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 43034 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7927:b0:130:ccc6:6c4b with SMTP id b39csp2030513pzg; Sun, 30 Jul 2023 15:12:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlHeb5M5T9fd9tXbO6vfugKgMtsmEWTmMwnddp/ahcxfsjw5rTqYH+KU8BX+l8nCKDsK7hmp X-Received: by 2002:a05:6512:1594:b0:4fe:1d71:6076 with SMTP id bp20-20020a056512159400b004fe1d716076mr5078428lfb.46.1690755154703; Sun, 30 Jul 2023 15:12:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690755154; cv=none; d=google.com; s=arc-20160816; b=j10vxy+agXuFgoZFnEuNgykOi4C3OS6UeDT6dyjmdZjR3fdiVAbEGL3Ymjmc/NRSmE TULhri4r1rzLyF6/KtFIC7dH4ysX3OSPlRRyOefI9L+JfzuvaxsLIOMn6s7hc0rKc4M5 rym3j+NzY9gSNA9nADnVuK+ujd5ByrwQ62hKYvfqZDbzaV/GHeb3acaGzy6SISRGJn9e QjaUBY3UQ0+OKGa9aT+rgQ52kugXYgDzaj20S4logy14zpMb4hJicIaID2anAGgvJrNe tpknu3vRG60YWhBaCan5du+3qDucVQHbDLpZe0Rnka2f5oZbug/GdXHhxqXN62treHUd /vVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=T5MbvG4vSObZAshtwtXlyVWwglJapkkub4U8n2v1XPk=; fh=YYwLYmpaV0Fpw/rxmSKNRLS2XzDkAlGbHATiKOPtZrY=; b=FLBZu0s7GMGc8n7i+Je9y9gqyUZRj45wRC+zEo90PKvVTMbV4iHgErzo+eXEcAg4va zy6zuOwXRYIOQCzf72hd24kg4XTZ6dm+MrMZq5URszFSzHImXxcnbaa/cI/CG2jv1hMb dJM83ViMkXYd0uMgT5RyK1GMdvNEHcpxzbZiwSNKkpGYdWBAAWb0O0WCzwNZVyCTO531 xkvRN4HZ5AXKTtKPYughaHZVaaS8rZMKUbmZh6+ni4pojBOAVQ8n1h5pHs4WyNu2AmMW IVxgvgKvfnwiTCctZHDjpNEXXT9NF9i8Q0sjNjEYRT4ylsOIp9tGcOzDrlO0/I/mFN8+ LGdA== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a18-20020aa7cf12000000b0052230def6ffsi6330896edy.234.2023.07.30.15.12.34; Sun, 30 Jul 2023 15:12:34 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BE1EC68C574; Mon, 31 Jul 2023 01:11:47 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7F20F68C54F for ; Mon, 31 Jul 2023 01:11:45 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id C8C0960004 for ; Sun, 30 Jul 2023 22:11:44 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 31 Jul 2023 00:11:28 +0200 Message-Id: <20230730221131.1205193-9-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230730221131.1205193-1-michael@niedermayer.cc> References: <20230730221131.1205193-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 09/12] avradio/avformat/sdrdemux: dont use a fuction name as local variable X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: /F+CS8yGDuTc Signed-off-by: Michael Niedermayer --- libavformat/sdrdemux.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavformat/sdrdemux.c b/libavformat/sdrdemux.c index 3f3390049c..0e327f4860 100644 --- a/libavformat/sdrdemux.c +++ b/libavformat/sdrdemux.c @@ -1043,13 +1043,13 @@ static int demodulate_fm(SDRContext *sdr, Station *station, AVStream *st, AVPack double carrier19_i_exact; int W= 5; double dc = 0, dcw = 0; - int len2 = FFMIN(index, 2*sdr->block_size - index); + int lenmax = FFMIN(index, 2*sdr->block_size - index); av_assert0(!st || (sst == station->stream && sst->station == station)); //If only some of the bandwidth is available, just try with less - if (len2 < len && len2 > len/2) - len = len2; + if (lenmax < len && lenmax > len/2) + len = lenmax; if (index + len >= 2*sdr->block_size || index - len < 0 || From patchwork Sun Jul 30 22:11:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 43035 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7927:b0:130:ccc6:6c4b with SMTP id b39csp2030567pzg; Sun, 30 Jul 2023 15:12:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlFA5lvKalNVFLrbyCasWWpjzEL2R4/H8RAqTMg9vu8pWT5U/FqGZSgw129n9H/pkI0+wHNZ X-Received: by 2002:a17:907:7799:b0:992:b3a3:81f4 with SMTP id ky25-20020a170907779900b00992b3a381f4mr5076879ejc.50.1690755164005; Sun, 30 Jul 2023 15:12:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690755163; cv=none; d=google.com; s=arc-20160816; b=yPy5ctECaREE4IBPVMtiHVGN3FzT9dYEbRU7bjjE+mx9qJ4Ik7AA8tEeHUwMtiPBcy BRJaOMPC81iM+SyrcV4wR8ltL35XlJeSMyXAmXC2y9nGgbn+O4aB5thYWn/8lJEYOhav /PiCbLWdgAQ72keZTyZJieVoTcvVzEHVid+kSVce9XMcWbRRuZiWAasReBpgefJuw6jd UCra8QWH9tBuQwfM3xnwstaJ1ZutUhC3+VwhpcGbZgfN81bbqS2LLEsvzTz4tlXnDHXA QDgSzdRpwnP0K6kRS9w+hYhKkBJJ/gH+3VSq30JMXLt53OgQ/f9GFkTt8Q35hUJ1d1tZ U80g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=w53o0mFpj+dadHaZGlAE9q6oA3ViekhsmKodHXSmY4U=; fh=YYwLYmpaV0Fpw/rxmSKNRLS2XzDkAlGbHATiKOPtZrY=; b=NCuv9xyNV6MOSkeeVCaphCdZ5MksxWmt9lJcoZ634D9R7iHSWZz00CEP2ZbQOi1QgH a48XECmgj5q6HKXS3ECAX9NLqZWK4zYMduCdVZlf+LsUNo7ezoqQvG0BahIvh3cIRZaU Jvoo9823bV9MWXboLM/1O1/I20gga8n3UidW4hCP+jcoDMc7JKYRdaYrbBMIJyW01QPb sBqNJnwN/UeWhp7LuE+QQ8MYNzw4fuN1pgesi/lJXLLY58KX2qJmN+Dssr+qWJmVTcGB DFwzaTqMhjQs2EZoINIWlA+WSHd6XJBHL90jCrMvZGCZpnoXESNinzAAjtGF+EqkHAyw uiIQ== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id qu17-20020a170907111100b0098889bf7f86si6283766ejb.315.2023.07.30.15.12.43; Sun, 30 Jul 2023 15:12:43 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EA66368C5A6; Mon, 31 Jul 2023 01:11:49 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8C0A168C55F for ; Mon, 31 Jul 2023 01:11:46 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id D462DC0002 for ; Sun, 30 Jul 2023 22:11:45 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 31 Jul 2023 00:11:29 +0200 Message-Id: <20230730221131.1205193-10-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230730221131.1205193-1-michael@niedermayer.cc> References: <20230730221131.1205193-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 10/12] avradio/avformat/sdrdemux: fix off by 2 FM bandwidth error X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: /j9knMxGUuVN Also adjust related parameters Signed-off-by: Michael Niedermayer --- libavformat/sdrdemux.c | 8 ++++---- tests/ref/fate/sdr-am | 25 ++++++++++++------------- tests/ref/fate/sdr-fm | 14 +++++++------- 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/libavformat/sdrdemux.c b/libavformat/sdrdemux.c index 0e327f4860..a40346ff31 100644 --- a/libavformat/sdrdemux.c +++ b/libavformat/sdrdemux.c @@ -704,7 +704,7 @@ static int demodulate_am(SDRContext *sdr, Station *station, AVStream *st, AVPack double freq = station->frequency; int64_t bandwidth = station->bandwidth; int index = lrint(F2INDEX(freq)); - int len = (bandwidth * 2ll * sdr->block_size + sdr->sdr_sample_rate/2) / sdr->sdr_sample_rate; + int len = (bandwidth * 1ll * sdr->block_size + sdr->sdr_sample_rate/2) / sdr->sdr_sample_rate; float *newbuf; float scale; int sample_rate = sdr->sdr_sample_rate * (int64_t)sdr->am_block_size / sdr->block_size; @@ -1030,7 +1030,7 @@ static int demodulate_fm(SDRContext *sdr, Station *station, AVStream *st, AVPack double freq = station->frequency; int64_t bandwidth = station->bandwidth; int index = lrint(F2INDEX(freq)); - int len = (bandwidth * 2ll * sdr->block_size + sdr->sdr_sample_rate/2) / sdr->sdr_sample_rate; + int len = (bandwidth * 1ll * sdr->block_size + sdr->sdr_sample_rate/2) / sdr->sdr_sample_rate; float *newbuf; float scale; int sample_rate = sdr->sdr_sample_rate * (int64_t)sdr->fm_block_size / sdr->block_size; @@ -1687,11 +1687,11 @@ int avpriv_sdr_common_init(AVFormatContext *s) av_log(s, AV_LOG_INFO, "Block size %d\n", sdr->block_size); sdr->block_time = sdr->block_size / (double)sdr->sdr_sample_rate; - sdr->am_bandwidth = 6 * 1000; + sdr->am_bandwidth = 12 * 1000; sdr->fm_bandwidth = 180 * 1000; sdr->fm_bandwidth_p2 = 16.5 * 1000; // Officially Stereo Broadcast FM has 15khz audio bandwidth - sdr->am_block_size = find_block_size(sdr, sdr->am_bandwidth); + sdr->am_block_size = find_block_size(sdr, sdr->am_bandwidth / 2); sdr->fm_block_size = find_block_size(sdr, sdr->fm_bandwidth); sdr->fm_block_size_p2 = find_block_size(sdr, sdr->fm_bandwidth_p2); diff --git a/tests/ref/fate/sdr-am b/tests/ref/fate/sdr-am index e2ae353902..992ec1936d 100644 --- a/tests/ref/fate/sdr-am +++ b/tests/ref/fate/sdr-am @@ -30,18 +30,17 @@ #channel_layout_name 5: stereo 0, 0, 0, 1, 320000, 0x816a0964 0, 1, 1, 1, 320000, 0x140ce2da -1, 2048, 2048, 1024, 2048, 0x4d31ff0f -2, 2048, 2048, 1024, 2048, 0x3cd002ad -3, 2048, 2048, 1024, 2048, 0x8bdd034d -4, 2048, 2048, 1024, 2048, 0xc6430169 -1, 3072, 3072, 1024, 2048, 0xb307000d -2, 3072, 3072, 1024, 2048, 0x3f6d01d4 -3, 3072, 3072, 1024, 2048, 0x2de9fde9 -4, 3072, 3072, 1024, 2048, 0xad7efe6f +1, 2048, 2048, 1024, 2048, 0x3cd002ad +2, 2048, 2048, 1024, 2048, 0x8bdd034d +3, 2048, 2048, 1024, 2048, 0xc6430169 +1, 3072, 3072, 1024, 2048, 0x3f6d01d4 +2, 3072, 3072, 1024, 2048, 0x2de9fde9 +3, 3072, 3072, 1024, 2048, 0xad7efe6f +4, 3072, 3072, 1024, 2048, 0x2c18fef7 5, 3072, 3072, 1024, 2048, 0x9c840168 -1, 4096, 4096, 1024, 2048, 0x7e7cfe03 -2, 4096, 4096, 1024, 2048, 0x6561fc7b -3, 4096, 4096, 1024, 2048, 0xdcd6ff8d -4, 4096, 4096, 1024, 2048, 0xedac0493 +1, 4096, 4096, 1024, 2048, 0x6561fc7b +2, 4096, 4096, 1024, 2048, 0xdcd6ff8d +3, 4096, 4096, 1024, 2048, 0xedac0493 +4, 4096, 4096, 1024, 2048, 0x7e7cfe03 5, 4096, 4096, 1024, 2048, 0x970a0066 -0, 3, 3, 1, 320000, 0x6ea8fa49 +0, 3, 3, 1, 320000, 0x76d901a2 diff --git a/tests/ref/fate/sdr-fm b/tests/ref/fate/sdr-fm index 3ae5adc2c0..97a2320a2a 100644 --- a/tests/ref/fate/sdr-fm +++ b/tests/ref/fate/sdr-fm @@ -15,11 +15,11 @@ #channel_layout_name 2: stereo 0, 0, 0, 1, 320000, 0xf553af75 0, 1, 1, 1, 320000, 0xeabc15b3 -1, 8196, 8196, 4096, 8192, 0x585d090e -2, 8196, 8196, 4096, 8192, 0xb966fb19 -1, 12292, 12292, 4096, 8192, 0x6d8ffe6e -2, 12292, 12292, 4096, 8192, 0x51d1fb50 +1, 8196, 8196, 4096, 8192, 0x4af5090c +2, 8196, 8196, 4096, 8192, 0x8e43fafd +1, 12292, 12292, 4096, 8192, 0x39fbfe6a +2, 12292, 12292, 4096, 8192, 0x7febfb59 0, 3, 3, 1, 320000, 0xf8b7b144 -1, 16388, 16388, 4096, 8192, 0x8c000600 -2, 16388, 16388, 4096, 8192, 0x335ff20c -0, 4, 4, 1, 320000, 0xab42bbc7 +1, 16388, 16388, 4096, 8192, 0x886a05fe +2, 16388, 16388, 4096, 8192, 0x0b2cf20d +0, 4, 4, 1, 320000, 0xf3a3bf66 From patchwork Sun Jul 30 22:11:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 43037 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7927:b0:130:ccc6:6c4b with SMTP id b39csp2030688pzg; Sun, 30 Jul 2023 15:13:02 -0700 (PDT) X-Google-Smtp-Source: APBJJlEbHrkV8RPJJhgVCOtaDNvA20ZNqles3UE3SlIkUOpwPLnFzcNHj0JXL0BVHWMC5mvppSXN X-Received: by 2002:a05:6512:b9d:b0:4fd:d64f:c0a6 with SMTP id b29-20020a0565120b9d00b004fdd64fc0a6mr5538869lfv.48.1690755182343; Sun, 30 Jul 2023 15:13:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690755182; cv=none; d=google.com; s=arc-20160816; b=eHCA1xIZmIHxVdwU3PEsRUnkiO0AxgUzG5e0cv8yYL5P+3bzT17ZZmmsd+KVff4EW2 gnZQmEFk/EpRNpYxqxKcBfBW5RANb9kyJ45TbvtBRTtNMcmmNelCpCwhPdRWDdaDN4o5 +LiZ2kTDzHf3VoIWRsKmcYwRwx+KqqDPaj66PJ/G5f2bbDnl/zwAQlBXEKVep7jt4845 cClHfTRZGdGSYIcTAXqStblneiT54eeIQhLPQykBY6NvVkGuPThSNr9t4xIBv38znde9 zU1L5Ek4pVEE62iXXeAGR4Kz3MIpZ0rkUqEQxFs+eUtwP29f5mzJN1IMpWZlaYwcH3Z2 3IKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=T7rJdOmsTB1/KGGWZQJ4+dqYKP1rTsoXEEu8nsvujg8=; fh=YYwLYmpaV0Fpw/rxmSKNRLS2XzDkAlGbHATiKOPtZrY=; b=WmxxY7z2AuFYyxvW2tthyDWxtlPoSqDfrtiyVnMVF1LyUtZCDX8XyaC4GhBCkWbhZv nWLNYt/QdOdq0dBnn4d5+cAvege36mkcrLabEXRa3SL6v9t0Vu8LPqjib+YnIDvgTY0z /Z+h09P1HntiFEW150XY7+Y1TtrQ2C89SwT2nGD0z1Xto+7RWMmJZZDX85C7h0OJvjtY 362ipsJ0VNhQ9Z89Cf1nEDF0s9t6cFL4v3oyUnA7cDjUln+V/73mHuI8W0Ll+M2KTXDi 39OCO7iVFsO1PUYtu+1tVz4eggxlqcIg92zqfWbxL0EoMTTUxKhURJRYR0J6RUBhiY2+ wJ5w== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id o5-20020aa7c505000000b00522414e0582si5783999edq.371.2023.07.30.15.13.01; Sun, 30 Jul 2023 15:13:02 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1FC4A68C5B0; Mon, 31 Jul 2023 01:11:52 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9ED5968C55C for ; Mon, 31 Jul 2023 01:11:47 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id E752AFF802 for ; Sun, 30 Jul 2023 22:11:46 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 31 Jul 2023 00:11:30 +0200 Message-Id: <20230730221131.1205193-11-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230730221131.1205193-1-michael@niedermayer.cc> References: <20230730221131.1205193-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 11/12] avradio/avformat/sdrdemux: fix FM block size X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: M6R+uxbZMKve as we copied twice the bandwith needed previously, we now also need only half the block size. Done in a seperate patch for easier bisection Signed-off-by: Michael Niedermayer --- libavformat/sdrdemux.c | 2 +- tests/ref/fate/sdr-fm | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libavformat/sdrdemux.c b/libavformat/sdrdemux.c index a40346ff31..bda7387213 100644 --- a/libavformat/sdrdemux.c +++ b/libavformat/sdrdemux.c @@ -1692,7 +1692,7 @@ int avpriv_sdr_common_init(AVFormatContext *s) sdr->fm_bandwidth_p2 = 16.5 * 1000; // Officially Stereo Broadcast FM has 15khz audio bandwidth sdr->am_block_size = find_block_size(sdr, sdr->am_bandwidth / 2); - sdr->fm_block_size = find_block_size(sdr, sdr->fm_bandwidth); + sdr->fm_block_size = find_block_size(sdr, sdr->fm_bandwidth / 2); sdr->fm_block_size_p2 = find_block_size(sdr, sdr->fm_bandwidth_p2); sdr->windowed_block = av_malloc(sizeof(*sdr->windowed_block) * 2 * sdr->block_size); diff --git a/tests/ref/fate/sdr-fm b/tests/ref/fate/sdr-fm index 97a2320a2a..ef76e4f584 100644 --- a/tests/ref/fate/sdr-fm +++ b/tests/ref/fate/sdr-fm @@ -15,11 +15,11 @@ #channel_layout_name 2: stereo 0, 0, 0, 1, 320000, 0xf553af75 0, 1, 1, 1, 320000, 0xeabc15b3 -1, 8196, 8196, 4096, 8192, 0x4af5090c -2, 8196, 8196, 4096, 8192, 0x8e43fafd -1, 12292, 12292, 4096, 8192, 0x39fbfe6a -2, 12292, 12292, 4096, 8192, 0x7febfb59 +1, 8196, 8196, 4096, 8192, 0xdd0d10be +2, 8196, 8196, 4096, 8192, 0x98c4f547 +1, 12292, 12292, 4096, 8192, 0xaf58fbdc +2, 12292, 12292, 4096, 8192, 0x6d53f60a 0, 3, 3, 1, 320000, 0xf8b7b144 -1, 16388, 16388, 4096, 8192, 0x886a05fe -2, 16388, 16388, 4096, 8192, 0x0b2cf20d +1, 16388, 16388, 4096, 8192, 0x03640b38 +2, 16388, 16388, 4096, 8192, 0x1216e352 0, 4, 4, 1, 320000, 0xf3a3bf66 From patchwork Sun Jul 30 22:11:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 43039 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7927:b0:130:ccc6:6c4b with SMTP id b39csp2030801pzg; Sun, 30 Jul 2023 15:13:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlGvPx5cpQzupHUlon4pqTlwN3vGzYSJ2OYnagD4+92IS2grRxGakk2cDxW1F7E/IV7px/K2 X-Received: by 2002:a17:906:1003:b0:992:ef60:aadd with SMTP id 3-20020a170906100300b00992ef60aaddmr5477811ejm.13.1690755200873; Sun, 30 Jul 2023 15:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690755200; cv=none; d=google.com; s=arc-20160816; b=Q34yb9TTMxKVa6PvQVG3MK0+hnSwtecwu8LfwJNORjT2i7a+CNWDHVIh+jysxMjxwx Hib32sp0xXDml63z2D892+a+BqdEE+HqM9cReKEeTwZvGJ0cO5Hybwq+koK6gDd9yS9y /X2rppPBsT4U8PawCXPphsxA9ZB63aMuJju4xZRC8xB0KjJIXkEMeGYbnwQ0dAqa1Ckb THaPzFvJssS1wBOaqMzWNLxrZ8jCPN8/dapS1FDwSdeVJObJbl4C8wP/XGpKH8geXyJX 8f5N0n7Ol5aaC6kQPMeHpXKG8GWSeU+qYm1mll7+BO0PU7MfBdItnvhUbsVFcGMhb9C4 RsYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=9dDyZRILWEtT3c3kRKc92VP+4tQVu/DEvpUifhv505w=; fh=YYwLYmpaV0Fpw/rxmSKNRLS2XzDkAlGbHATiKOPtZrY=; b=aFNCcWdTC/CRs1c4bkK4pLh/5OnoWMiH/JgPfymXp/RTlw7tVFGpmG3zfGSuKGr3Hr wB6dJuxb/MRNKhsWBLkKTcBza4+JBFS8I3Gala8xWJ0CMeUe1oCSniGvT9BYR1TQK3oV JbzFm9vn4l9MndbZocStdkcch8h6JUYvdJhJMXosOjRAzq1vFpXch0/QRmWX9JDGKH4l OPp77HMzer/fNmkdaT4yo3ZyeUB1WWjWD7nWn5IYEHd7KvDDe35jxg0AmVqUcD8MH49F v5vD4AopHS2T3/Whisi+yXQF4S2miIDTtEnpQDChZC/1cFfxZeRaIFvjEM/n0iEbQjic lKxQ== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id r15-20020a1709067fcf00b0099b7f483374si1458171ejs.183.2023.07.30.15.13.20; Sun, 30 Jul 2023 15:13:20 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5CF7868C5AA; Mon, 31 Jul 2023 01:11:54 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B9C8568C58E for ; Mon, 31 Jul 2023 01:11:48 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 072E2240005 for ; Sun, 30 Jul 2023 22:11:47 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 31 Jul 2023 00:11:31 +0200 Message-Id: <20230730221131.1205193-12-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230730221131.1205193-1-michael@niedermayer.cc> References: <20230730221131.1205193-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 12/12] avradio/avformat/sdrdemux: replace heuristic FM scaling by logic X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: M6a2JhRQzDC9 Signed-off-by: Michael Niedermayer --- libavformat/sdrdemux.c | 4 +++- tests/ref/fate/sdr-fm | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/libavformat/sdrdemux.c b/libavformat/sdrdemux.c index bda7387213..f8590a2e18 100644 --- a/libavformat/sdrdemux.c +++ b/libavformat/sdrdemux.c @@ -1135,7 +1135,9 @@ static int demodulate_fm(SDRContext *sdr, Station *station, AVStream *st, AVPack if (!newbuf) return AVERROR(ENOMEM); - scale = 5 / (M_PI * 2*sdr->fm_block_size); + //ATAN gives us +-PI the following 2 transforms scale by the given values, we reverse this here + scale = 1.0 / (M_PI * sqrt(2*sdr->fm_block_size * 2*sdr->fm_block_size_p2)); + for(i = 0; ifm_block_size_p2; i++) { float m, q; diff --git a/tests/ref/fate/sdr-fm b/tests/ref/fate/sdr-fm index ef76e4f584..526f53a2bd 100644 --- a/tests/ref/fate/sdr-fm +++ b/tests/ref/fate/sdr-fm @@ -15,11 +15,11 @@ #channel_layout_name 2: stereo 0, 0, 0, 1, 320000, 0xf553af75 0, 1, 1, 1, 320000, 0xeabc15b3 -1, 8196, 8196, 4096, 8192, 0xdd0d10be -2, 8196, 8196, 4096, 8192, 0x98c4f547 -1, 12292, 12292, 4096, 8192, 0xaf58fbdc -2, 12292, 12292, 4096, 8192, 0x6d53f60a +1, 8196, 8196, 4096, 8192, 0x12b50769 +2, 8196, 8196, 4096, 8192, 0xeb93fbff +1, 12292, 12292, 4096, 8192, 0xba21feb7 +2, 12292, 12292, 4096, 8192, 0x3ef2fc7b 0, 3, 3, 1, 320000, 0xf8b7b144 -1, 16388, 16388, 4096, 8192, 0x03640b38 -2, 16388, 16388, 4096, 8192, 0x1216e352 +1, 16388, 16388, 4096, 8192, 0xdea20516 +2, 16388, 16388, 4096, 8192, 0x7538f52b 0, 4, 4, 1, 320000, 0xf3a3bf66