Re: [FFmpeg-devel] Is it legal to modify h264 sps for cropping

2017-04-21 Thread Xiaolei Yu
On 04/21/2017 10:15 PM, Hendrik Leppkes wrote:
> On Fri, Apr 21, 2017 at 3:34 PM, Xiaolei Yu  wrote:
>> Some android devices do not properly align the input surface of MediaCodec 
>> (Nexus 4, Galxy Note 2) and
>> we are forced to specify a multiple of 16 as the video width. A possible 
>> workaround is to insert the desired crop
>> into the output sps, but I am not sure if it is legal.
> 
> H.264 always has a coded dimension which is a multiple of 16, and any
> smaller granularity on actual dimensions is achieved with cropping
> parameters.

I understand coding internally handles only 16x16 blocks. But I am not sure
whether a decoder is required to decode full blocks first before applying the
cropping. What happens if prediction requires data out side of the cropping 
area?

Say I have a 1088x1920 h264 file and crop it to (0,0 - 1080,1920) by editing 
the sps,
can I expect the new file is still conformant and the decoded images match 
those of
the original file in the cropped area?


> 
> - Hendrik
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Is it legal to modify h264 sps for cropping

2017-04-21 Thread Hendrik Leppkes
On Fri, Apr 21, 2017 at 3:34 PM, Xiaolei Yu  wrote:
> Some android devices do not properly align the input surface of MediaCodec 
> (Nexus 4, Galxy Note 2) and
> we are forced to specify a multiple of 16 as the video width. A possible 
> workaround is to insert the desired crop
> into the output sps, but I am not sure if it is legal.

H.264 always has a coded dimension which is a multiple of 16, and any
smaller granularity on actual dimensions is achieved with cropping
parameters.

- Hendrik
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] Is it legal to modify h264 sps for cropping

2017-04-21 Thread Xiaolei Yu
Some android devices do not properly align the input surface of MediaCodec 
(Nexus 4, Galxy Note 2) and 
we are forced to specify a multiple of 16 as the video width. A possible 
workaround is to insert the desired crop
into the output sps, but I am not sure if it is legal.

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel