[vlc-devel] [PATCH 6/7] picture: don't write the interlaced state in each picture

Steve Lhomme robux4 at ycbcr.xyz
Fri Nov 6 15:42:13 CET 2020


It's already in the video format and should be changed through it.
---
 modules/codec/aom.c                       | 1 -
 modules/codec/avcodec/video.c             | 1 -
 modules/codec/dav1d.c                     | 1 -
 modules/codec/libmpeg2.c                  | 2 --
 modules/codec/omxil/mediacodec.c          | 1 -
 modules/codec/rawvideo.c                  | 3 ---
 modules/codec/schroedinger.c              | 1 -
 modules/codec/theora.c                    | 1 -
 modules/codec/videotoolbox.c              | 3 +--
 modules/codec/vpx.c                       | 1 -
 modules/codec/xwd.c                       | 1 -
 modules/hw/mmal/deinterlace.c             | 3 +--
 modules/hw/mmal/mmal_picture.h            | 1 -
 modules/hw/nvdec/nvdec.c                  | 6 ------
 modules/hw/vaapi/filters.c                | 5 -----
 modules/hw/vdpau/deinterlace.c            | 2 --
 modules/video_filter/deinterlace/common.c | 1 -
 modules/visualization/visual/visual.c     | 1 -
 18 files changed, 2 insertions(+), 33 deletions(-)

diff --git a/modules/codec/aom.c b/modules/codec/aom.c
index 2a87347dbbe..45d59b25254 100644
--- a/modules/codec/aom.c
+++ b/modules/codec/aom.c
@@ -254,7 +254,6 @@ static void OutputFrame(decoder_t *dec, const struct aom_image *img)
 
             /* fetches back the PTS */
 
-            pic->b_progressive = true; /* codec does not support interlacing */
             pic->date = p_sys->frame_priv[(uintptr_t)img->user_priv].pts;
 
             decoder_QueueVideo(dec, pic);
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 78e05917640..c342417f71d 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -1229,7 +1229,6 @@ static int DecodeBlock( decoder_t *p_dec, block_t **pp_block )
         /* Hack to force display of still pictures */
         p_pic->b_force = p_sys->b_first_frame;
         p_pic->i_nb_fields = 2 + frame->repeat_pict;
-        p_pic->b_progressive = !frame->interlaced_frame;
         p_pic->b_top_field_first = frame->top_field_first;
 
         if (DecodeSidedata(p_dec, frame, p_pic))
diff --git a/modules/codec/dav1d.c b/modules/codec/dav1d.c
index f5a0566bf6a..0922c002ebb 100644
--- a/modules/codec/dav1d.c
+++ b/modules/codec/dav1d.c
@@ -345,7 +345,6 @@ static int Decode(decoder_t *dec, block_t *block)
                     b_output_error = true;
                     break;
                 }
-                pic->b_progressive = true; /* codec does not support interlacing */
                 pic->date = img.m.timestamp;
                 decoder_QueueVideo(dec, pic);
                 ExtractCaptions(dec, &img);
diff --git a/modules/codec/libmpeg2.c b/modules/codec/libmpeg2.c
index 6ea02981728..91348514402 100644
--- a/modules/codec/libmpeg2.c
+++ b/modules/codec/libmpeg2.c
@@ -693,8 +693,6 @@ static picture_t *GetNewPicture( decoder_t *p_dec )
     if( p_pic == NULL )
         return NULL;
 
-    p_pic->b_progressive = p_sys->p_info->current_picture != NULL ?
-        p_sys->p_info->current_picture->flags & PIC_FLAG_PROGRESSIVE_FRAME : 1;
     p_pic->b_top_field_first = p_sys->p_info->current_picture != NULL ?
         p_sys->p_info->current_picture->flags & PIC_FLAG_TOP_FIELD_FIRST : 1;
     p_pic->i_nb_fields = p_sys->p_info->current_picture != NULL ?
diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
index e6758dbc320..81b6cd94afb 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -1098,7 +1098,6 @@ static int Video_ProcessOutput(decoder_t *p_dec, mc_api_out *p_out,
             p_pic->date = p_out->buf.i_ts;
         else
             p_pic->date = forced_ts;
-        p_pic->b_progressive = true;
 
         if (p_sys->api.b_direct_rendering)
         {
diff --git a/modules/codec/rawvideo.c b/modules/codec/rawvideo.c
index b569d35367c..1000007fd1c 100644
--- a/modules/codec/rawvideo.c
+++ b/modules/codec/rawvideo.c
@@ -261,15 +261,12 @@ static int DecodeFrame( decoder_t *p_dec, block_t *p_block )
 
     if( p_block->i_flags & BLOCK_FLAG_INTERLACED_MASK )
     {
-        p_pic->b_progressive = false;
         p_pic->i_nb_fields = (p_block->i_flags & BLOCK_FLAG_SINGLE_FIELD) ? 1 : 2;
         if( p_block->i_flags & BLOCK_FLAG_TOP_FIELD_FIRST )
             p_pic->b_top_field_first = true;
         else
             p_pic->b_top_field_first = false;
     }
-    else
-        p_pic->b_progressive = true;
 
     block_Release( p_block );
     decoder_QueueVideo( p_dec, p_pic );
diff --git a/modules/codec/schroedinger.c b/modules/codec/schroedinger.c
index 32cca737f91..96323b2f702 100644
--- a/modules/codec/schroedinger.c
+++ b/modules/codec/schroedinger.c
@@ -711,7 +711,6 @@ static SchroFrame *CreateSchroFrameFromPic( decoder_t *p_dec )
         }
     }
 
-    p_pic->b_progressive = !p_sys->p_format->interlaced;
     p_pic->b_top_field_first = p_sys->p_format->top_field_first;
     p_pic->i_nb_fields = 2;
 
diff --git a/modules/codec/theora.c b/modules/codec/theora.c
index 072cd350b1b..883d4cee751 100644
--- a/modules/codec/theora.c
+++ b/modules/codec/theora.c
@@ -535,7 +535,6 @@ static picture_t *DecodePacket( decoder_t *p_dec, ogg_packet *p_oggpacket )
     theora_CopyPicture( p_pic, ycbcr );
 
     p_pic->date = p_sys->i_pts;
-    p_pic->b_progressive = true;
 
     return p_pic;
 }
diff --git a/modules/codec/videotoolbox.c b/modules/codec/videotoolbox.c
index 9f937b3efea..cbd70cf9e80 100644
--- a/modules/codec/videotoolbox.c
+++ b/modules/codec/videotoolbox.c
@@ -2205,8 +2205,7 @@ static void DecoderCallback(void *decompressionOutputRefCon,
         p_pic->date = pts.value;
         p_pic->b_force = p_info->b_eos;
         p_pic->b_still = p_info->b_eos;
-        p_pic->b_progressive = p_info->b_progressive;
-        if (!p_pic->b_progressive)
+        if (p_dec->fmt_out.video.interlaced)
         {
             p_pic->i_nb_fields = p_info->i_num_ts;
             p_pic->b_top_field_first = p_info->b_top_field_first;
diff --git a/modules/codec/vpx.c b/modules/codec/vpx.c
index 3d1770ba50c..ecceb7399f4 100644
--- a/modules/codec/vpx.c
+++ b/modules/codec/vpx.c
@@ -285,7 +285,6 @@ static int Decode(decoder_t *dec, block_t *block)
         }
     }
 
-    pic->b_progressive = true; /* codec does not support interlacing */
     pic->date = pts;
 
     decoder_QueueVideo(dec, pic);
diff --git a/modules/codec/xwd.c b/modules/codec/xwd.c
index 813b3e2c4fe..ec145e6f47c 100644
--- a/modules/codec/xwd.c
+++ b/modules/codec/xwd.c
@@ -121,7 +121,6 @@ static int Decode (decoder_t *dec, block_t *block)
         out += pic->p->i_pitch;
     }
     pic->date = block->i_pts;
-    pic->b_progressive = true;
 
 drop:
     block_Release(block);
diff --git a/modules/hw/mmal/deinterlace.c b/modules/hw/mmal/deinterlace.c
index d6b1ee420fb..3d89265cce4 100644
--- a/modules/hw/mmal/deinterlace.c
+++ b/modules/hw/mmal/deinterlace.c
@@ -347,8 +347,7 @@ static void di_flush(filter_t *p_filter)
 static picture_t * pass_deinterlace(filter_t * p_filter, picture_t * p_pic)
 {
     VLC_UNUSED(p_filter);
-
-    p_pic->b_progressive = true;
+    VLC_UNUSED(p_pic);
     return p_pic;
 }
 
diff --git a/modules/hw/mmal/mmal_picture.h b/modules/hw/mmal/mmal_picture.h
index cd613ccaff6..62c24953252 100644
--- a/modules/hw/mmal/mmal_picture.h
+++ b/modules/hw/mmal/mmal_picture.h
@@ -95,7 +95,6 @@ static inline void buf_to_pic_copy_props(picture_t * const pic, const MMAL_BUFFE
 {
     // Contrary to docn the interlace & tff flags turn up in the header flags rather than the
     // video specific flags (which appear to be currently unused).
-    pic->b_progressive = (buf->flags & MMAL_BUFFER_HEADER_VIDEO_FLAG_INTERLACED) == 0;
     pic->b_top_field_first = (buf->flags & MMAL_BUFFER_HEADER_VIDEO_FLAG_TOP_FIELD_FIRST) != 0;
 
     pic->date = buf->pts != MMAL_TIME_UNKNOWN ? buf->pts :
diff --git a/modules/hw/nvdec/nvdec.c b/modules/hw/nvdec/nvdec.c
index a0bcd8f5588..776cf588254 100644
--- a/modules/hw/nvdec/nvdec.c
+++ b/modules/hw/nvdec/nvdec.c
@@ -554,14 +554,8 @@ static int CUDAAPI HandlePictureDisplay(void *p_opaque, CUVIDPARSERDISPINFO *p_d
 
     if (p_sys->deintMode == cudaVideoDeinterlaceMode_Weave)
     {
-        // the picture has not been deinterlaced, forward the field parameters
-        p_pic->b_progressive = p_dispinfo->progressive_frame;
         p_pic->i_nb_fields = 2 + p_dispinfo->repeat_first_field;
     }
-    else
-    {
-        p_pic->b_progressive = true;
-    }
     p_pic->b_top_field_first = p_dispinfo->top_field_first;
     p_pic->date = p_dispinfo->timestamp;
 
diff --git a/modules/hw/vaapi/filters.c b/modules/hw/vaapi/filters.c
index fa800399f02..c2f5bf6f699 100644
--- a/modules/hw/vaapi/filters.c
+++ b/modules/hw/vaapi/filters.c
@@ -835,9 +835,6 @@ Deinterlace(filter_t * filter, picture_t * src)
                Deinterlace_UpdateReferenceFrames,
                Deinterlace_UpdatePipelineParams);
 
-    if (dest)
-        dest->b_progressive = true;
-
     return dest;
 }
 
@@ -884,8 +881,6 @@ DeinterlaceX2(filter_t * filter, picture_t * src)
                          Deinterlace_UpdatePipelineParams);
         if (!dest[i])
            goto error;
-
-        dest[i]->b_progressive = true;
         dest[i]->i_nb_fields = 1;
     }
 
diff --git a/modules/hw/vdpau/deinterlace.c b/modules/hw/vdpau/deinterlace.c
index 818a42749ec..7e319bef2a8 100644
--- a/modules/hw/vdpau/deinterlace.c
+++ b/modules/hw/vdpau/deinterlace.c
@@ -91,8 +91,6 @@ static picture_t *Deinterlace(filter_t *filter, picture_t *src)
         f2->structure = VDP_VIDEO_MIXER_PICTURE_STRUCTURE_TOP_FIELD;
     }
 
-    src->b_progressive = true;
-    dst->b_progressive = true;
     return src;
 }
 
diff --git a/modules/video_filter/deinterlace/common.c b/modules/video_filter/deinterlace/common.c
index a1bab1f1c50..082342c1738 100644
--- a/modules/video_filter/deinterlace/common.c
+++ b/modules/video_filter/deinterlace/common.c
@@ -336,7 +336,6 @@ picture_t *DoDeinterlacing( filter_t *p_filter,
     {
         if( p_dst[i] )
         {
-            p_dst[i]->b_progressive = true;
             p_dst[i]->i_nb_fields = 2;
         }
     }
diff --git a/modules/visualization/visual/visual.c b/modules/visualization/visual/visual.c
index c3591944ad7..ecb5da9162f 100644
--- a/modules/visualization/visual/visual.c
+++ b/modules/visualization/visual/visual.c
@@ -346,7 +346,6 @@ static block_t *DoRealWork( filter_t *p_filter, block_t *p_in_buf )
 
     /* First, get a new picture */
     picture_t *p_outpic = vout_GetPicture( p_sys->p_vout );
-    p_outpic->b_progressive = true;
     if( unlikely(p_outpic == NULL) )
         return p_in_buf;
 
-- 
2.26.2



More information about the vlc-devel mailing list