From patchwork Fri Jul 10 16:07:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: knneth@gmail.com X-Patchwork-Id: 20947 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 2707444AE66 for ; Fri, 10 Jul 2020 19:35:08 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0481A689DC8; Fri, 10 Jul 2020 19:35:08 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 01326689AE3 for ; Fri, 10 Jul 2020 19:35:01 +0300 (EEST) Received: by mail-ej1-f66.google.com with SMTP id o18so6749277eje.7 for ; Fri, 10 Jul 2020 09:35:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=RXVPhhymjQLW40Pu6qJk9n1j+rRiQBmdT8n+WlKKwuU=; b=sHK3c7pyKO87sy40PA0gIfczlh4ajlQhPLJ2U6YgoOB7xt9BZoJKDapb+heTQuHulk qlbg5vLcB08PRND2ksfJyXigWZZGS+XFsYUlYVPZUduwXmUcUY2GyGCzYsqDZIrIzNsk BxLKxLK/QpT8nUYSZLOU8vHJLdcRCkhXLkU3DAk3bx3yl+6J8aDhVhIp54K8KieCBZoX HEWNg9/M2tIJnB1egDxmQYb1QhXIijD8Mvp8YaoJ/hLjDn/U/0Y8aU+lb3O0SxtjM7Xh jCL1J7SpZIly8hO0089nKmN0yW/h+KPpsXRwpdYjDeyHT2N219FirQBwlj/0GRPBBh9S 3VKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=RXVPhhymjQLW40Pu6qJk9n1j+rRiQBmdT8n+WlKKwuU=; b=rMhE8MpEmn/Kl3pjJLCcV3uXN7LVM+pB3KRZTC+Ucllt8AtamKm/HOmVOjjE2pmRwE 6aeyrx9XmPubNHRKI3sLxODdJpmT+Y9qdY4PUuAKLu2tlj358CbnL63EV+qeb0DwfQhw I7SIuBvsUHhDWGBTw9n5S3z4DhzGzHhWm4wSDBtHmbTH2CMqcGBo8xeqtIhRSOx3UlCm OesmtpAuKENp93VvdvcDrvZg6zbW8GwozKlnPXoNy0SxIZ/Buk3b1RlY+QqaZv62SlmN ArIbYH1TujhSYEjcb6TicdfmyCJhVcQnQ3DgSFjOU+TUDr7dgXdcGSm+QSSkAd008sBG Lu+w== X-Gm-Message-State: AOAM533txxoeTK5mC+73WGvqLNTzvf0RbFFRbEiED+GjEIhiLu0nWKfc mUvhoaly8FFNVj7u01rpMK8Gbw4SzA== X-Google-Smtp-Source: ABdhPJxeOwsqzvZFcNr+SynJkdgHfc1g0fuZXFkIXJryiTEVZv11WnMFJr2crwwVMsuiAxmj4wT1qQ== X-Received: by 2002:ac2:5226:: with SMTP id i6mr44088492lfl.55.1594397272013; Fri, 10 Jul 2020 09:07:52 -0700 (PDT) Received: from bleeding.dev.btech ([176.111.206.84]) by smtp.gmail.com with ESMTPSA id d6sm2057316lja.77.2020.07.10.09.07.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Jul 2020 09:07:51 -0700 (PDT) From: knneth@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Fri, 10 Jul 2020 16:07:26 +0000 Message-Id: <1594397247-169433-1-git-send-email-knneth@gmail.com> X-Mailer: git-send-email 1.8.3.1 Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/s302m: document ST 302 format 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 Cc: Kenneth Klette Jonassen MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Kenneth Klette Jonassen ST 302:2007 is the latest iteration of the transport specification and replaces the older SMPTE 302M name. To avoid possible end-user confusion, we'll update the description in source code comments only. Fill in a few important pieces of the bitstream documentation that is specific to ST 302, so that it is possible to understand the decoder without access to the ST 302 spec (which is behind a paywall). Signed-off-by: Kenneth Klette Jonassen --- libavcodec/s302m.c | 26 +++++++++++++++++++------- libavcodec/s302menc.c | 3 ++- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/libavcodec/s302m.c b/libavcodec/s302m.c index 584b58e..1e49e9e 100644 --- a/libavcodec/s302m.c +++ b/libavcodec/s302m.c @@ -1,5 +1,6 @@ /* - * SMPTE 302M decoder + * ST 302 decoder (aka. SMPTE 302M) + * Mapping of AES3 Data into MPEG-2 Transport Stream * Copyright (c) 2008 Laurent Aimar * Copyright (c) 2009 Baptiste Coudurier * @@ -46,12 +47,23 @@ static int s302m_parse_frame_header(AVCodecContext *avctx, const uint8_t *buf, } /* - * AES3 header : - * size: 16 - * number channels 2 - * channel_id 8 - * bits per samples 2 - * alignments 4 + * ST 302 AES3 data header: + * size: 16 bytes of data payload (excl. this header) + * number channels 2 number of data channels + * channel_id 8 first data channel in packet + * bits per sample 2 16/20/24 bits (0x3 is reserved value) + * alignment 4 reserved/zero + * + * Followed by ST 302 AES3 data payload containing AES3 subframes + * + * Each subframe contains one data word + 4 bits VUCF (AES3 VUC bits + + * Framing bit). Framing bit indicates first subframe of AES3 block and + * the start of U(ser data) and C(hannel status) information. + * Framing bit replaces Parity bit in regular AES3 subframes. + * See an AES3 reference (like Wikipedia) for more information. + * + * Word rate (sample rate) shall be 48 kHz, and shall be locked + * to the 27MHz transport clock. */ h = AV_RB32(buf); diff --git a/libavcodec/s302menc.c b/libavcodec/s302menc.c index b04a54e..99e7350 100644 --- a/libavcodec/s302menc.c +++ b/libavcodec/s302menc.c @@ -1,5 +1,6 @@ /* - * SMPTE 302M encoder + * ST 302 encoder (aka. SMPTE 302M) + * Mapping of AES3 Data into MPEG-2 Transport Stream * Copyright (c) 2010 Google, Inc. * Copyright (c) 2013 Darryl Wallace *