diff mbox series

[FFmpeg-devel] Speedhq: Decode field 2 correctly

Message ID 20200510160951.88091-1-jb@videolan.org
State Accepted
Commit fc3f5cd149326b0a478c9a4a34acc22cf757ef02
Headers show
Series [FFmpeg-devel] Speedhq: Decode field 2 correctly | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Jean-Baptiste Kempf May 10, 2020, 4:09 p.m. UTC
This is similar to field 1 (effd2e72)
---
 libavcodec/speedhq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul B Mahol May 14, 2020, 7:28 p.m. UTC | #1
Do you have actual file this fixes?

On 5/10/20, Jean-Baptiste Kempf <jb@videolan.org> wrote:
> This is similar to field 1 (effd2e72)
> ---
>  libavcodec/speedhq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c
> index 890b8253cd..b834b79f28 100644
> --- a/libavcodec/speedhq.c
> +++ b/libavcodec/speedhq.c
> @@ -447,7 +447,7 @@ static int speedhq_decode_frame(AVCodecContext *avctx,
>      }
>      frame->key_frame = 1;
>
> -    if (second_field_offset == 4) {
> +    if (second_field_offset == 4 || second_field_offset == (buf_size-4)) {
>          /*
>           * Overlapping first and second fields is used to signal
>           * encoding only a single field. In this case, "height"
> --
> 2.26.2
>
> _______________________________________________
> 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".
Jean-Baptiste Kempf June 18, 2020, 4:28 p.m. UTC | #2
Sorry for the late answer.

There are no actual files, but this is used in the NDI streams.
There is a new library for that here:
https://code.videolan.org/jbk/libndi/ and this is how I found out about that.

On Thu, May 14, 2020, at 21:28, Paul B Mahol wrote:
> Do you have actual file this fixes?
> 
> On 5/10/20, Jean-Baptiste Kempf <jb@videolan.org> wrote:
> > This is similar to field 1 (effd2e72)
> > ---
> >  libavcodec/speedhq.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c
> > index 890b8253cd..b834b79f28 100644
> > --- a/libavcodec/speedhq.c
> > +++ b/libavcodec/speedhq.c
> > @@ -447,7 +447,7 @@ static int speedhq_decode_frame(AVCodecContext *avctx,
> >      }
> >      frame->key_frame = 1;
> >
> > -    if (second_field_offset == 4) {
> > +    if (second_field_offset == 4 || second_field_offset == (buf_size-4)) {
> >          /*
> >           * Overlapping first and second fields is used to signal
> >           * encoding only a single field. In this case, "height"
> > --
> > 2.26.2
> >
> > _______________________________________________
> > 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".
> _______________________________________________
> 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".
Carl Eugen Hoyos June 18, 2020, 4:40 p.m. UTC | #3
Am Do., 18. Juni 2020 um 18:28 Uhr schrieb Jean-Baptiste Kempf
<jb@videolan.org>:
>
> Sorry for the late answer.
>
> There are no actual files, but this is used in the NDI streams.
> There is a new library for that here:
> https://code.videolan.org/jbk/libndi/ and this is how I found out about that.

Given that this is one relatively small C file:
Can't this be committed to our source tree?

Carl Eugen
Jean-Baptiste Kempf June 18, 2020, 4:43 p.m. UTC | #4
On Thu, Jun 18, 2020, at 18:40, Carl Eugen Hoyos wrote:
> Am Do., 18. Juni 2020 um 18:28 Uhr schrieb Jean-Baptiste Kempf
> <jb@videolan.org>:
> >
> > Sorry for the late answer.
> >
> > There are no actual files, but this is used in the NDI streams.
> > There is a new library for that here:
> > https://code.videolan.org/jbk/libndi/ and this is how I found out about that.
> 
> Given that this is one relatively small C file:
> Can't this be committed to our source tree?

At some point, yes, I think this is advisable. I think I will send it myself.
But I think that currently, this is very alpha-stage, and it might not cover all the NDI variants that we might want.

Best,
Carl Eugen Hoyos June 18, 2020, 4:46 p.m. UTC | #5
Am Do., 18. Juni 2020 um 18:44 Uhr schrieb Jean-Baptiste Kempf
<jb@videolan.org>:
>
> On Thu, Jun 18, 2020, at 18:40, Carl Eugen Hoyos wrote:
> > Am Do., 18. Juni 2020 um 18:28 Uhr schrieb Jean-Baptiste Kempf
> > <jb@videolan.org>:
> > >
> > > Sorry for the late answer.
> > >
> > > There are no actual files, but this is used in the NDI streams.
> > > There is a new library for that here:
> > > https://code.videolan.org/jbk/libndi/ and this is how I found out about that.
> >
> > Given that this is one relatively small C file:
> > Can't this be committed to our source tree?
>
> At some point, yes, I think this is advisable. I think I will send it myself.
> But I think that currently, this is very alpha-stage, and it might not cover
> all the NDI variants that we might want.

Thank you for the explanation!

Carl Eugen
diff mbox series

Patch

diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c
index 890b8253cd..b834b79f28 100644
--- a/libavcodec/speedhq.c
+++ b/libavcodec/speedhq.c
@@ -447,7 +447,7 @@  static int speedhq_decode_frame(AVCodecContext *avctx,
     }
     frame->key_frame = 1;
 
-    if (second_field_offset == 4) {
+    if (second_field_offset == 4 || second_field_offset == (buf_size-4)) {
         /*
          * Overlapping first and second fields is used to signal
          * encoding only a single field. In this case, "height"