From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 51F584675F for ; Sat, 17 Jun 2023 08:11:18 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 725C868C382; Sat, 17 Jun 2023 11:11:16 +0300 (EEST) Received: from shout02.mail.de (shout02.mail.de [62.201.172.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3D1D268BFB0 for ; Sat, 17 Jun 2023 11:11:10 +0300 (EEST) Received: from postfix03.mail.de (postfix03.bt.mail.de [10.0.121.127]) by shout02.mail.de (Postfix) with ESMTP id B6890A0E8D for ; Sat, 17 Jun 2023 10:11:09 +0200 (CEST) Received: from smtp02.mail.de (smtp02.bt.mail.de [10.0.121.212]) by postfix03.mail.de (Postfix) with ESMTP id 9C77C800C3 for ; Sat, 17 Jun 2023 10:11:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.de; s=mailde202009; t=1686989469; bh=lFgsxqmYGY9E0n6CbecTHfbbHynhQgsDdlpxwaXEQIk=; h=From:To:Subject:Date:Message-Id:From:To:CC:Subject:Reply-To; b=nQR7tl6fRVfcwUUQPCdYHELufcxrsxRUVR2Hmq2+HyjxRvdZbWdo3fB9anan4KjAx MYTW3EUGUCSrGzFeSbwjhe9OGx5c+u1bfh+9MvRCV5udybLviBJsgFrADSFhsOJm9x kAxf1NJrvVWsl4QlCB9MklW5AJ/x7R1FtKy4Uv6sASr/ilaLSjgOpTLdZmPFmzlCzz vmVxZKN0R272h0yxjQ4uqgJ5GlPc2TmtmR4h4UyWxZveGV9UDbXstTwqqWYwC8C9hX LXlkhOwJQYIe5odTvdO38SctQ94iiAWwUU+5zoi/K+yEJ9EI3m4n0hNcZrQDuVGMAe 4aY7Zfc4H3t+A== Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtp02.mail.de (Postfix) with ESMTPSA id 70C6FA0519 for ; Sat, 17 Jun 2023 10:11:09 +0200 (CEST) From: Thilo Borgmann To: ffmpeg-devel@ffmpeg.org Date: Sat, 17 Jun 2023 10:11:07 +0200 Message-Id: <20230617081108.10051-1-thilo.borgmann@mail.de> MIME-Version: 1.0 X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 1680 X-purgate-ID: 154282::1686989469-9D67D199-C5765730/0/0 Subject: [FFmpeg-devel] [PATCH v1 1/2] lavc/vp9: set yuvj pixel format for full range decode 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: While the yuvj pixel formats are deprecated lots of code still relies on them to be set. Without setting a yuvj420p pixel format VP9 decoding ends up incorrectly due to auto conversion. suggested-by: ffmpeg@meta.com --- libavcodec/vp9.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index 4f704ec0dd..e7be755fe6 100644 --- a/libavcodec/vp9.c +++ b/libavcodec/vp9.c @@ -202,6 +202,7 @@ static int update_size(AVCodecContext *avctx, int w, int h) switch (s->pix_fmt) { case AV_PIX_FMT_YUV420P: + case AV_PIX_FMT_YUVJ420P: case AV_PIX_FMT_YUV420P10: #if CONFIG_VP9_DXVA2_HWACCEL *fmtp++ = AV_PIX_FMT_DXVA2_VLD; @@ -509,6 +510,25 @@ static int read_colorspace_details(AVCodecContext *avctx) s->ss_h = s->ss_v = 1; s->pix_fmt = pix_fmt_for_ss[bits][1][1]; } + + if (avctx->color_range == AVCOL_RANGE_JPEG) { + switch (s->pix_fmt) { + case AV_PIX_FMT_YUV444P: + s->pix_fmt = AV_PIX_FMT_YUVJ444P; + break; + case AV_PIX_FMT_YUV422P: + s->pix_fmt = AV_PIX_FMT_YUVJ422P; + break; + case AV_PIX_FMT_YUV440P: + s->pix_fmt = AV_PIX_FMT_YUVJ440P; + break; + case AV_PIX_FMT_YUV420P: + s->pix_fmt = AV_PIX_FMT_YUVJ420P; + break; + default: + break; + } + } } return 0; -- 2.37.1 (Apple Git-137.1) _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".