Re: [FFmpeg-devel] H.261 chroma motion vector rounding.

2017-04-03 Thread Christina Brien
> For both positive and negative numbers. > > 3 / 2 = 1 > -3 / 2 = -1 You’re right. I was confusing integer division by a power of two, with right-shifting. The bug was in my code all along. I apologise for wasting your time. Christina ___ ffmpeg-de

Re: [FFmpeg-devel] H.261 chroma motion vector rounding.

2017-04-02 Thread Christina Brien
> On 2 Apr 2017, at 22:03, Hendrik Leppkes wrote: > > C integer divison truncates, that equals rounding towards zero. For positive numbers, yes. 3 (0b 0011) is right shifted with sign-insertion to 1. -3 (0b 1 1 11101) is right shifted w

Re: [FFmpeg-devel] H.261 chroma motion vector rounding.

2017-04-02 Thread Christina Brien
> wouldn't > ROUNDED_DIV() macro be more appropriate? ROUNDED_DIV rounds to nearest. The specification states to round towards zero. > the Changelog is not supposed to include these kind of changes. I assumed Changelog was for incompatible changes, of which this would be. I have removed the cha

[FFmpeg-devel] H.261 chroma motion vector rounding.

2017-04-02 Thread Christina Brien
Hi Having written a clean-room implementation of H.261 and comparing it to the output of FFMPEG, I have found that FFMPEG is not spec-compliant with regard to negative chroma motion vectors. The spec states that chroma motion vectors are the luma motion vectors divided by two, and rounded *towa

[FFmpeg-devel] H.261 chroma motion vector rounding.

2017-04-02 Thread Christina Brien
Hi Having written a clean-room implementation of H.261 and comparing it to the output of FFMPEG, I have found that FFMPEG is not spec-compliant with regard to negative chroma motion vectors. The spec states that chroma motion vectors are the luma motion vectors divided by two, and rounded *towa