Re: [libav-devel] [PATCH 2/5] vc1dec: Invoke edge emulation regardless of MV precision for 1-MV chroma
On Tue, Oct 09, 2012 at 04:38:16PM -0400, Mashiat Sarker Shakkhar wrote: > This is required due to the way VC-1 handles chroma pull-back which may end > up causing negative chroma MV for zero luma MV. Edge emulation needs to be > invoked in such cases. > > This problem only affects chroma Y motion vector. Ahem, that sentence induces cognitive dissonance: first you see "chroma Y" and think "why not Cb luma", then you move further and see it's actually "Y motion vector". As far as I remember, Y is merely one component of motion vector, so please reformulate it a bit, like "only affects vertical component of chroma motion vector" or so. > --- > libavcodec/vc1dec.c |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c > index 42eb4a5..2683c86 100644 > --- a/libavcodec/vc1dec.c > +++ b/libavcodec/vc1dec.c > @@ -430,7 +430,7 @@ static void vc1_mc_1mv(VC1Context *v, int dir) > if (v->rangeredfrm || (v->mv_mode == MV_PMODE_INTENSITY_COMP) > || s->h_edge_pos < 22 || v_edge_pos < 22 > || (unsigned)(src_x - s->mspel) > s->h_edge_pos - (mx&3) - 16 - > s->mspel * 3 > -|| (unsigned)(src_y - s->mspel) > v_edge_pos- (my&3) - 16 - > s->mspel * 3) { > +|| (unsigned)(src_y - 1)> v_edge_pos- (my&3) - 16 - 3) { > uint8_t *uvbuf = s->edge_emu_buffer + 19 * s->linesize; > > srcY -= s->mspel * (1 + s->linesize); > -- The patch looks OK. ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 2/5] vc1dec: Invoke edge emulation regardless of MV precision for 1-MV chroma
Hi, On Tue, Oct 9, 2012 at 4:56 PM, Mashiat Sarker Shakkhar wrote: > On 10/9/2012 7:37 PM, Ronald S. Bultje wrote: >> >> Hi, >> >> On Tue, Oct 9, 2012 at 1:38 PM, Mashiat Sarker Shakkhar >> wrote: >>> >>> This is required due to the way VC-1 handles chroma pull-back which may >>> end >>> up causing negative chroma MV for zero luma MV. Edge emulation needs to >>> be >>> invoked in such cases. >>> >>> This problem only affects chroma Y motion vector. >>> --- >>> libavcodec/vc1dec.c |2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c >>> index 42eb4a5..2683c86 100644 >>> --- a/libavcodec/vc1dec.c >>> +++ b/libavcodec/vc1dec.c >>> @@ -430,7 +430,7 @@ static void vc1_mc_1mv(VC1Context *v, int dir) >>> if (v->rangeredfrm || (v->mv_mode == MV_PMODE_INTENSITY_COMP) >>> || s->h_edge_pos < 22 || v_edge_pos < 22 >>> || (unsigned)(src_x - s->mspel) > s->h_edge_pos - (mx&3) - 16 - >>> s->mspel * 3 >>> -|| (unsigned)(src_y - s->mspel) > v_edge_pos- (my&3) - 16 - >>> s->mspel * 3) { >>> +|| (unsigned)(src_y - 1)> v_edge_pos- (my&3) - 16 - >>> 3) { >> >> >> I'm slightly curious why this is only the case for the vertical >> dimension, but not the horizontal. Is that intentional, or an >> oversight? > > > This thread contains my earlier discussion on a rejected patch which tried > to fix the same bug: > > http://patches.libav.org/patch/26240/ OK so it's not because of pullback per se, but because of field adjustment, then it makes sense. Ronald ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 2/5] vc1dec: Invoke edge emulation regardless of MV precision for 1-MV chroma
On 10/9/2012 7:37 PM, Ronald S. Bultje wrote: Hi, On Tue, Oct 9, 2012 at 1:38 PM, Mashiat Sarker Shakkhar wrote: This is required due to the way VC-1 handles chroma pull-back which may end up causing negative chroma MV for zero luma MV. Edge emulation needs to be invoked in such cases. This problem only affects chroma Y motion vector. --- libavcodec/vc1dec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 42eb4a5..2683c86 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -430,7 +430,7 @@ static void vc1_mc_1mv(VC1Context *v, int dir) if (v->rangeredfrm || (v->mv_mode == MV_PMODE_INTENSITY_COMP) || s->h_edge_pos < 22 || v_edge_pos < 22 || (unsigned)(src_x - s->mspel) > s->h_edge_pos - (mx&3) - 16 - s->mspel * 3 -|| (unsigned)(src_y - s->mspel) > v_edge_pos- (my&3) - 16 - s->mspel * 3) { +|| (unsigned)(src_y - 1)> v_edge_pos- (my&3) - 16 - 3) { I'm slightly curious why this is only the case for the vertical dimension, but not the horizontal. Is that intentional, or an oversight? This thread contains my earlier discussion on a rejected patch which tried to fix the same bug: http://patches.libav.org/patch/26240/ ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 2/5] vc1dec: Invoke edge emulation regardless of MV precision for 1-MV chroma
Hi, On Tue, Oct 9, 2012 at 1:38 PM, Mashiat Sarker Shakkhar wrote: > This is required due to the way VC-1 handles chroma pull-back which may end > up causing negative chroma MV for zero luma MV. Edge emulation needs to be > invoked in such cases. > > This problem only affects chroma Y motion vector. > --- > libavcodec/vc1dec.c |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c > index 42eb4a5..2683c86 100644 > --- a/libavcodec/vc1dec.c > +++ b/libavcodec/vc1dec.c > @@ -430,7 +430,7 @@ static void vc1_mc_1mv(VC1Context *v, int dir) > if (v->rangeredfrm || (v->mv_mode == MV_PMODE_INTENSITY_COMP) > || s->h_edge_pos < 22 || v_edge_pos < 22 > || (unsigned)(src_x - s->mspel) > s->h_edge_pos - (mx&3) - 16 - > s->mspel * 3 > -|| (unsigned)(src_y - s->mspel) > v_edge_pos- (my&3) - 16 - > s->mspel * 3) { > +|| (unsigned)(src_y - 1)> v_edge_pos- (my&3) - 16 - 3) { I'm slightly curious why this is only the case for the vertical dimension, but not the horizontal. Is that intentional, or an oversight? Ronald ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 2/5] vc1dec: Invoke edge emulation regardless of MV precision for 1-MV chroma
This is required due to the way VC-1 handles chroma pull-back which may end up causing negative chroma MV for zero luma MV. Edge emulation needs to be invoked in such cases. This problem only affects chroma Y motion vector. --- libavcodec/vc1dec.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 42eb4a5..2683c86 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -430,7 +430,7 @@ static void vc1_mc_1mv(VC1Context *v, int dir) if (v->rangeredfrm || (v->mv_mode == MV_PMODE_INTENSITY_COMP) || s->h_edge_pos < 22 || v_edge_pos < 22 || (unsigned)(src_x - s->mspel) > s->h_edge_pos - (mx&3) - 16 - s->mspel * 3 -|| (unsigned)(src_y - s->mspel) > v_edge_pos- (my&3) - 16 - s->mspel * 3) { +|| (unsigned)(src_y - 1)> v_edge_pos- (my&3) - 16 - 3) { uint8_t *uvbuf = s->edge_emu_buffer + 19 * s->linesize; srcY -= s->mspel * (1 + s->linesize); -- 1.7.9.5 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel