Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 14/18] avcodec/vp8: Move fade_present from context to stack
Date: Sat, 10 Sep 2022 03:07:25 +0200
Message-ID: <AS8P250MB07444823F8B80D5F8BF06AA08F429@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <AS8P250MB0744923C03A16E5BF7BE11B28F429@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM>

It is only an auxiliary value used for parsing the VP7 frame header.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
I think that vp7_fade_frame() needs a check for whether the
previous frame is writable before writing to it.
Does anyone have a sample for this fading?

 libavcodec/vp8.c | 6 +++---
 libavcodec/vp8.h | 5 -----
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index a7df4601ef..baf9820ce6 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -580,6 +580,7 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
     int height = s->avctx->height;
     int alpha = 0;
     int beta  = 0;
+    int fade_present = 1;
 
     if (buf_size < 4) {
         return AVERROR_INVALIDDATA;
@@ -679,7 +680,6 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
 
     s->update_last          = 1;
     s->update_probabilities = 1;
-    s->fade_present         = 1;
 
     if (s->profile > 0) {
         s->update_probabilities = vp89_rac_get(c);
@@ -687,13 +687,13 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
             s->prob[1] = s->prob[0];
 
         if (!s->keyframe)
-            s->fade_present = vp89_rac_get(c);
+            fade_present = vp89_rac_get(c);
     }
 
     if (vpx_rac_is_end(c))
         return AVERROR_INVALIDDATA;
     /* E. Fading information for previous frame */
-    if (s->fade_present && vp89_rac_get(c)) {
+    if (fade_present && vp89_rac_get(c)) {
         alpha = (int8_t) vp89_rac_get_uint(c, 8);
         beta  = (int8_t) vp89_rac_get_uint(c, 8);
     }
diff --git a/libavcodec/vp8.h b/libavcodec/vp8.h
index ed79bc79c1..db0155237a 100644
--- a/libavcodec/vp8.h
+++ b/libavcodec/vp8.h
@@ -335,11 +335,6 @@ typedef struct VP8Context {
 
     int vp7;
 
-    /**
-     * Fade bit present in bitstream (VP7)
-     */
-    int fade_present;
-
     /**
      * Interframe DC prediction (VP7)
      * [0] VP8_FRAME_PREVIOUS
-- 
2.34.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".

  parent reply	other threads:[~2022-09-10  1:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-10  0:19 [FFmpeg-devel] [PATCH 01/18] avcodec/vp8: Disable segmentation for VP7 Andreas Rheinhardt
2022-09-10  1:07 ` [FFmpeg-devel] [PATCH 02/18] avcodec/vp8: Disable lf_delta " Andreas Rheinhardt
2022-09-11  4:29   ` Peter Ross
2022-09-11  4:38     ` Andreas Rheinhardt
2022-09-11 14:41       ` Ronald S. Bultje
2022-09-11 15:09         ` Ronald S. Bultje
2022-09-11 22:41       ` Peter Ross
2022-09-10  1:07 ` [FFmpeg-devel] [PATCH 03/18] avcodec/vp8: Remove unused macros Andreas Rheinhardt
2022-09-10  1:07 ` [FFmpeg-devel] [PATCH 04/18] avcodec/vp8: Inline mb_layout for VP7 Andreas Rheinhardt
2022-09-10  1:07 ` [FFmpeg-devel] [PATCH 05/18] avcodec/vp8: Inline inner_filter " Andreas Rheinhardt
2022-09-10  1:07 ` [FFmpeg-devel] [PATCH 06/18] avcodec/vp8: Inline mbskip_enabled " Andreas Rheinhardt
2022-09-10  1:07 ` [FFmpeg-devel] [PATCH 07/18] avcodec/vp8: Pass mb_y explicitly Andreas Rheinhardt
2022-09-10  1:07 ` [FFmpeg-devel] [PATCH 08/18] avcodec/vp8: Inline num_coeff_partitions for VP7 Andreas Rheinhardt
2022-09-10  1:07 ` [FFmpeg-devel] [PATCH 09/18] avcodec/vp8: Disable slice-thread synchronization code " Andreas Rheinhardt
2022-09-10  1:07 ` [FFmpeg-devel] [PATCH 10/18] avcodec/vp8: Inline num_jobs " Andreas Rheinhardt
2022-09-10  1:07 ` [FFmpeg-devel] [PATCH 11/18] avcodec/vp8: Inline jobnr, threadnr " Andreas Rheinhardt
2022-09-10  1:07 ` [FFmpeg-devel] [PATCH 12/18] avcodec/vp8: Inline update_last " Andreas Rheinhardt
2022-09-10  1:07 ` [FFmpeg-devel] [PATCH 13/18] avcodec/vp8: Don't use avctx->execute2 " Andreas Rheinhardt
2022-09-10  1:07 ` Andreas Rheinhardt [this message]
2022-09-10  1:07 ` [FFmpeg-devel] [PATCH 15/18] avcodec/vp8: Disable frame-threading code " Andreas Rheinhardt
2022-09-10  1:07 ` [FFmpeg-devel] [PATCH 16/18] avcodec/vp8dsp: Remove declarations of inexistent functions Andreas Rheinhardt
2022-09-10  1:07 ` [FFmpeg-devel] [PATCH 17/18] avcodec/vp8dsp: Constify src in vp8_mc_func Andreas Rheinhardt
2022-09-10  1:07 ` [FFmpeg-devel] [PATCH 18/18] avcodec/vp8: Add const where appropriate Andreas Rheinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AS8P250MB07444823F8B80D5F8BF06AA08F429@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git