diff mbox

[FFmpeg-devel,2/5] avcodec/vc1: fix mquant calculation for interlace field pictures

Message ID 44213cf8-c2dd-02b6-fe9d-08c8c8261ee9@carpalis.nl
State Accepted
Commit c0402e1e30c2318359af1bce1d652f4616b21566
Headers show

Commit Message

Jerome Borsboom May 18, 2018, 3:06 p.m. UTC
For interlace field pictures s->mb_height indicates the height of the full
picture in MBs, i.e. the two fields combined. A single field is half this
size. When calculating mquant for interlace field pictures, the bottom edge
is the last MB row of the field.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
---
 libavcodec/vc1_block.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer May 19, 2018, 10:01 p.m. UTC | #1
On Fri, May 18, 2018 at 05:06:23PM +0200, Jerome Borsboom wrote:
> For interlace field pictures s->mb_height indicates the height of the full
> picture in MBs, i.e. the two fields combined. A single field is half this
> size. When calculating mquant for interlace field pictures, the bottom edge
> is the last MB row of the field.
> 
> Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
> ---
>  libavcodec/vc1_block.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

for patch 1 you list a file that it improves. Are there testcase
known that the other patches improve ?
(such testcase would be usefull for fate for example)

[...]
Carl Eugen Hoyos May 20, 2018, 7:51 a.m. UTC | #2
2018-05-20 0:01 GMT+02:00, Michael Niedermayer <michael@niedermayer.cc>:
> On Fri, May 18, 2018 at 05:06:23PM +0200, Jerome Borsboom wrote:
>> For interlace field pictures s->mb_height indicates the height of the
>> full
>> picture in MBs, i.e. the two fields combined. A single field is half this
>> size. When calculating mquant for interlace field pictures, the bottom
>> edge
>> is the last MB row of the field.
>>
>> Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
>> ---
>>  libavcodec/vc1_block.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> for patch 1 you list a file that it improves.

The file - afaict - is related to the patchset as a whole.
The current version of the patchset does not fix the
file though, so I believe we should wait for a new
version of the patchset.

The sample is >20MB, most of the reference files are
very small, so perhaps we can avoid using this one.

Carl Eugen
Jerome Borsboom May 20, 2018, 9 a.m. UTC | #3
>> On Fri, May 18, 2018 at 05:06:23PM +0200, Jerome Borsboom wrote:
>>> For interlace field pictures s->mb_height indicates the height of the
>>> full
>>> picture in MBs, i.e. the two fields combined. A single field is half this
>>> size. When calculating mquant for interlace field pictures, the bottom
>>> edge
>>> is the last MB row of the field.
>>>
>>> Signed-off-by: Jerome Borsboom <jerome.borsboom at carpalis.nl>
>>> ---
>>>  libavcodec/vc1_block.c | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> for patch 1 you list a file that it improves.
> 
> The file - afaict - is related to the patchset as a whole.
> The current version of the patchset does not fix the
> file though, so I believe we should wait for a new
> version of the patchset.
> 
> The sample is >20MB, most of the reference files are
> very small, so perhaps we can avoid using this one.
> 
> Carl Eugen

The issue that remains is not related to this patch set. In my view,
there is no need to wait for a new patch set. I will just submit a new
patch for that issue.

Regards,
Jerome
Carl Eugen Hoyos May 20, 2018, 10:52 a.m. UTC | #4
2018-05-20 11:00 GMT+02:00, Jerome Borsboom <jerome.borsboom@carpalis.nl>:

>>> for patch 1 you list a file that it improves.
>>
>> The file - afaict - is related to the patchset as a whole.
>> The current version of the patchset does not fix the
>> file though, so I believe we should wait for a new
>> version of the patchset.

> The issue that remains is not related to this patch set. In
> my view, there is no need to wait for a new patch set.

Thank you for clarifying this!

Carl Eugen
Carl Eugen Hoyos May 28, 2018, 9:47 p.m. UTC | #5
2018-05-18 17:06 GMT+02:00, Jerome Borsboom <jerome.borsboom@carpalis.nl>:
> For interlace field pictures s->mb_height indicates the height of the full
> picture in MBs, i.e. the two fields combined. A single field is half this
> size. When calculating mquant for interlace field pictures, the bottom edge
> is the last MB row of the field.
>
> Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
> ---
>  libavcodec/vc1_block.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c
> index daf30fdbfe..aa2ea5024e 100644
> --- a/libavcodec/vc1_block.c
> +++ b/libavcodec/vc1_block.c
> @@ -181,7 +181,8 @@ static void vc1_put_signed_blocks_clamped(VC1Context *v)
>              mquant = -v->altpq;                                \
>          if ((edges&4) && s->mb_x == (s->mb_width - 1))         \
>              mquant = -v->altpq;                                \
> -        if ((edges&8) && s->mb_y == (s->mb_height - 1))        \
> +        if ((edges&8) &&                                       \
> +            s->mb_y == ((s->mb_height >> v->field_mode) - 1))  \
>              mquant = -v->altpq;                                \
>          if (!mquant || mquant > 31) {                          \
>              av_log(v->s.avctx, AV_LOG_ERROR,                   \

Patch applied.

Thank you, Carl Eugen
diff mbox

Patch

diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c
index daf30fdbfe..aa2ea5024e 100644
--- a/libavcodec/vc1_block.c
+++ b/libavcodec/vc1_block.c
@@ -181,7 +181,8 @@  static void vc1_put_signed_blocks_clamped(VC1Context *v)
             mquant = -v->altpq;                                \
         if ((edges&4) && s->mb_x == (s->mb_width - 1))         \
             mquant = -v->altpq;                                \
-        if ((edges&8) && s->mb_y == (s->mb_height - 1))        \
+        if ((edges&8) &&                                       \
+            s->mb_y == ((s->mb_height >> v->field_mode) - 1))  \
             mquant = -v->altpq;                                \
         if (!mquant || mquant > 31) {                          \
             av_log(v->s.avctx, AV_LOG_ERROR,                   \