Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/lib/ffmpeg/libavcodec/h264.c b/lib/ffmpeg/libavcodec/h264.c
- index 31d43df..a1aac56 100644
- --- a/lib/ffmpeg/libavcodec/h264.c
- +++ b/lib/ffmpeg/libavcodec/h264.c
- @@ -1723,6 +1723,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
- unsigned int slice_type, tmp, i, j;
- int default_ref_list_done = 0;
- int last_pic_structure;
- + unsigned int crop_left, crop_right, crop_top, crop_bottom;
- s->dropable= h->nal_ref_idc == 0;
- @@ -1798,11 +1799,30 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
- h->b_stride= s->mb_width*4;
- - s->width = 16*s->mb_width - 2*FFMIN(h->sps.crop_right, 7);
- - if(h->sps.frame_mbs_only_flag)
- - s->height= 16*s->mb_height - 2*FFMIN(h->sps.crop_bottom, 7);
- - else
- - s->height= 16*s->mb_height - 4*FFMIN(h->sps.crop_bottom, 7);
- + s->width = 16*s->mb_width;
- + s->height= 16*s->mb_height;
- +
- + crop_left = 2*FFMIN(h->sps.crop_left, 7);
- + crop_right = 2*FFMIN(h->sps.crop_right, 7);
- + crop_top = 2*FFMIN(h->sps.crop_top, 7) * (2 - h->sps.frame_mbs_only_flag);
- + crop_bottom = 2*FFMIN(h->sps.crop_bottom, 7) * (2 - h->sps.frame_mbs_only_flag);
- +
- + s->width = 16*s->mb_width;
- + s->height= 16*s->mb_height;
- +
- + if(s->avctx->hwaccel || (s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)) {
- + h->pan_scan.width = 16 * (s->width - crop_left - crop_right);
- + h->pan_scan.height = 16 * (s->height - crop_top - crop_bottom);
- + h->pan_scan.position[0][0] = 16 * crop_left;
- + h->pan_scan.position[1][0] = 16 * (crop_left >> s->chroma_x_shift);
- + h->pan_scan.position[2][0] = 16 * (crop_left >> s->chroma_x_shift);
- + h->pan_scan.position[0][1] = 16 * crop_top;
- + h->pan_scan.position[1][1] = 16 * (crop_top >> s->chroma_y_shift);
- + h->pan_scan.position[2][1] = 16 * (crop_top >> s->chroma_y_shift);
- + } else {
- + s->width -= crop_right;
- + s->height -= crop_bottom;
- + }
- if (s->context_initialized
- && ( s->width != s->avctx->width || s->height != s->avctx->height
- @@ -3032,7 +3052,7 @@ static int decode_frame(AVCodecContext *avctx,
- } else {
- cur->interlaced_frame = 0;
- cur->repeat_pict = 0;
- -
- + *cur->pan_scan = h->pan_scan;
- /* Signal interlacing information externally. */
- /* Prioritize picture timing SEI information over used decoding process if it exists. */
- diff --git a/lib/ffmpeg/libavcodec/h264.h b/lib/ffmpeg/libavcodec/h264.h
- index bdca237..10f60b9 100644
- --- a/lib/ffmpeg/libavcodec/h264.h
- +++ b/lib/ffmpeg/libavcodec/h264.h
- @@ -593,6 +593,8 @@ typedef struct H264Context{
- int sei_buffering_period_present; ///< Buffering period SEI flag
- int initial_cpb_removal_delay[32]; ///< Initial timestamps for CPBs
- + AVPanScan pan_scan;
- +
- //SVQ3 specific fields
- int halfpel_flag;
- int thirdpel_flag;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement