From patchwork Thu Nov 7 13:06:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc-Antoine ARNAUD X-Patchwork-Id: 52622 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:2fe5:b0:4a6:1c7:11b7 with SMTP id kw5csp1397234vqb; Thu, 7 Nov 2024 05:07:17 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV7bn9WwqQycl62uWyOqKFAskIrcAdKV7riI+bNzs1gGvcu08gKbBi1xAmBK4u/wHNhvfWkDl6LAA4lmN6bV4/w@gmail.com X-Google-Smtp-Source: AGHT+IEIgT9rbkf6cAU4w5AtSQqngkL4YVvyI6zVK2d3uCixZtH9KC8lGKHMBLrRDcA5C55IpQJA X-Received: by 2002:a05:6512:31c3:b0:539:8b49:8939 with SMTP id 2adb3069b0e04-53d8409e494mr604598e87.41.1730984836742; Thu, 07 Nov 2024 05:07:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730984836; cv=none; d=google.com; s=arc-20240605; b=IgsHHYLL8GQyxRnuhEton1xC2pPbblpgUWqaRRTYaq/KvkEfT5+7yAsVFn+7xuL0PW iM5m3FM/xW8iJuiw+SlgmyXz1kf4Fby4hf4N6prwPE79RsMil+XclUA7hh6v1JyHQA67 t+/tNkr9SF8yzBozskannXaVTeRrA8zwHgUdMK5aMJc0cNJJQfzRmBxPruLuxXex2wfV FKI+hl+O/Uwlse44AJ9ffbslonp8m6YchA+s7eXPyUNgsrjMQpAs22RL8GvESrhAFnLE 9/mfwAVwDIchPaMIx8HYzCdNJHZLl8A4drbX5AummjliC9Cxe7Qs/GqCcqF+2lK8z2dx dzNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:to:message-id:date:from:mime-version :dkim-signature:delivered-to; bh=Lbrn/mVarSvCLCgBAAEfXehx2D2p39GdiKiCIngDaWA=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=KEX4pf05xJH8UPywhz9uQJytb0RiCuzrgkzsBzbXjqPaYplgKN17blPGRreWLyUKzb jxfZ1EBJyWXsfqJskirwOpHQVUM8E9nkwZVjEHGfQxcHnC1C6NISk6ALf3wu8zyulHam SqhEA29Rf3ixjgUSCP5UkSjOduezEtPTOrUROMy8Gagx0YFOeZdpjMZVmnGlZeckMe4Z wfJylcbw7FcQrFVtJvyJq6iXfeuWNtuIk21HzjFr/E8UsVqVVDAlgwrYVH9JgJXfnAJQ JitviOpcFqRoVLoWainuCPNfcqohznXxCFp/aSiHgMy0oC6DNCgObBt8FU354BlczOXg N7PA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@luminvent-com.20230601.gappssmtp.com header.s=20230601 header.b=TUDH+3j8; 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=luminvent.com; dara=fail header.i=@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 2adb3069b0e04-53d8267f5a8si562065e87.103.2024.11.07.05.07.16; Thu, 07 Nov 2024 05:07:16 -0800 (PST) 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=@luminvent-com.20230601.gappssmtp.com header.s=20230601 header.b=TUDH+3j8; 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=luminvent.com; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0755E68DE70; Thu, 7 Nov 2024 15:07:12 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A378368DB88 for ; Thu, 7 Nov 2024 15:07:05 +0200 (EET) Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a9ec267b879so145866366b.2 for ; Thu, 07 Nov 2024 05:07:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=luminvent-com.20230601.gappssmtp.com; s=20230601; t=1730984824; x=1731589624; darn=ffmpeg.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=CXbWKK5DZrz6ygUaWQfPspFbLU4kJhDwtPMlv2LBUSk=; b=TUDH+3j8CDtY1k4k+hD52AgRoDQL1RLa1VEB0KgXz6ZgI+yA4XdFSO5lnU3GxLFNWc 9xqb5XvcGCPOk2bnPxlVH0XCtmPAN73GZ2/qqmRZkID7tNECbSrl24uMdt+BTD808Uta IbOG2SuE/FUFf3PI1DxKSxbiXJT6Dh/VBmYa8CBo3Gt+rU1nYgsMfX9pg5LBDuDOE/co s112h7cD6MMOcgrNfqE9D7O305ADkbhvVQl2ftkoyglzXK9T7tmGSRMRH9yB/H1rlClI yH/p/v0tnX7C3PCqzuQg6fLA2Ml+97Y8/ugkbNv9qCxRX4/eEf5Joi9y458DigS9xl4F U7zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730984824; x=1731589624; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=CXbWKK5DZrz6ygUaWQfPspFbLU4kJhDwtPMlv2LBUSk=; b=XRIT3nfvmwXI00fQxOhX05rV28Fblx9P4Aasq0cHUnXcV4pgG8Tg9u/2g7iaUW1BDb QOSx1JRhevAYFbPsEEfj3r1IJ0y4FA+BpPumWfnr4kXVId0j9M1Vatg3pxA7GdTP6gLs qR72UIRpiMRYh9iDHUlHvQUywRizFWuoaVrY6Qg4vNl3d2VnS4LsMnWnMyFYDeBLi7S9 EKzVL4KiB4v+dvSlOhJCUVDghA6tpASoPl4hP1FqQtd/009ftVUauWY3lxtrzyA4WJwF tWEHliPHgqmOBM91kW033ef0FZPvzF43WbKSR+XPREVNkgC9zVfJSf5u2VA3/8Bj+iRC j6sA== X-Gm-Message-State: AOJu0Yynv+cg9BfXWGBn7NkJ/gJCcgMDfGX6RvnnrUs+zWCK/HAqeTxg N3zdfa8+TuXSMxJ+/Oq3BmkDoaYRMRrIBMYGNMTjSZjskwFruyEiViS3vTPRkLntBCCutZVURsA aRNR26vxp0JC7WtXvnVl0MHIIER1pTRqDKk/0FIEhPCoGCqns5gU= X-Received: by 2002:a17:906:ee8e:b0:a9e:e1a9:8ddf with SMTP id a640c23a62f3a-a9ee74c54a3mr103835066b.29.1730984823387; Thu, 07 Nov 2024 05:07:03 -0800 (PST) MIME-Version: 1.0 From: Marc-Antoine ARNAUD Date: Thu, 7 Nov 2024 14:06:47 +0100 Message-ID: To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] avcodec/libopenjpeg: set guard bits to 1 for 2K cinema 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: TxRCvl0+3izl Signed-off-by: Marc-Antoine Arnaud Signed-off-by: Marc-Antoine Arnaud --- libavcodec/libopenjpegenc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) if (!stream) { -- 2.39.3 (Apple Git-146) diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c index 06937cb9cac..ee2513d2a38 100644 --- a/libavcodec/libopenjpegenc.c +++ b/libavcodec/libopenjpegenc.c @@ -691,6 +691,17 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt, ret = AVERROR_EXTERNAL; goto done; } + + if (ctx->cinema_mode == OPJ_CINEMA2K_24 || ctx->profile == OPJ_CINEMA2K) { + const char* options[4] = { NULL, NULL }; + char szGuardBits[32]; + int guard_bits = 1; + sprintf(szGuardBits, "GUARD_BITS=%d", guard_bits); + options[0] = szGuardBits; + + opj_encoder_set_extra_options(compress, options); + } + stream = opj_stream_default_create(OPJ_STREAM_WRITE);