hevc/sao: optimze sao implementation

- adding one extra pixel all around the frame
- do not copy when SAO is not applied

5% improvement

cherry picked from commit 10fc29fc19a12c4d8168fbe1a954b76386db12d0
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/hevc: fix pict_type

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Write valid free atom when -moov_size is specified.

Fixes ticket #3769.
Parse dri when receiving jpg via rtp.

Based on a patch by contact at iridiummobile ru.
Fixes ticket #3780.
Ignore xing frame count if the file size is wrong.

Based on suggestions by Nicolas.
Fixes ticket #3777.
Analyzed-by: Oliver Fromme