Merge commit 'be039278b5ebd8075d90a3508db2aed5adf59e02'
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 17 Mar 2014 12:23:48 +0000 (13:23 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 17 Mar 2014 12:23:48 +0000 (13:23 +0100)
* commit 'be039278b5ebd8075d90a3508db2aed5adf59e02':
  mpegvideo: move ff_draw_horiz_band() to mpegutils.c

Conflicts:
libavcodec/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
configure
libavcodec/Makefile
libavcodec/mpegutils.c
libavcodec/mpegutils.h
libavcodec/mpegvideo.c
libavcodec/mpegvideo.h

diff --cc configure
Simple merge
@@@ -413,8 -336,7 +414,8 @@@ OBJS-$(CONFIG_SUNRAST_ENCODER)         
  OBJS-$(CONFIG_SVQ1_DECODER)            += svq1dec.o svq1.o svq13.o h263.o
  OBJS-$(CONFIG_SVQ1_ENCODER)            += svq1enc.o svq1.o    \
                                            h263.o ituh263enc.o
- OBJS-$(CONFIG_SVQ3_DECODER)            += svq3.o svq13.o
+ OBJS-$(CONFIG_SVQ3_DECODER)            += svq3.o svq13.o mpegutils.o
 +OBJS-$(CONFIG_TEXT_DECODER)            += textdec.o ass.o
  OBJS-$(CONFIG_TAK_DECODER)             += takdec.o tak.o
  OBJS-$(CONFIG_TARGA_DECODER)           += targa.o
  OBJS-$(CONFIG_TARGA_ENCODER)           += targaenc.o rle.o
index 0000000,bc430f0..62cc36a
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,80 +1,80 @@@
 - * This file is part of Libav.
+ /*
+  * Mpeg video formats-related defines and utility functions
+  *
 - * Libav is free software; you can redistribute it and/or
++ * This file is part of FFmpeg.
+  *
 - * Libav is distributed in the hope that it will be useful,
++ * FFmpeg is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU Lesser General Public
+  * License as published by the Free Software Foundation; either
+  * version 2.1 of the License, or (at your option) any later version.
+  *
 - * License along with Libav; if not, write to the Free Software
++ * FFmpeg is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
++ * License along with FFmpeg; if not, write to the Free Software
+  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+  */
+ #include <stdint.h>
+ #include "libavutil/common.h"
+ #include "libavutil/frame.h"
+ #include "libavutil/pixdesc.h"
+ #include "avcodec.h"
+ #include "mpegutils.h"
+ void ff_draw_horiz_band(AVCodecContext *avctx,
+                         AVFrame *cur, AVFrame *last,
+                         int y, int h, int picture_structure,
+                         int first_field, int low_delay)
+ {
+     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
+     int vshift = desc->log2_chroma_h;
+     const int field_pic = picture_structure != PICT_FRAME;
+     if (field_pic) {
+         h <<= 1;
+         y <<= 1;
+     }
+     h = FFMIN(h, avctx->height - y);
+     if (field_pic && first_field &&
+         !(avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD))
+         return;
+     if (avctx->draw_horiz_band) {
+         AVFrame *src;
+         int offset[AV_NUM_DATA_POINTERS];
+         int i;
+         if (cur->pict_type == AV_PICTURE_TYPE_B || low_delay ||
+            (avctx->slice_flags & SLICE_FLAG_CODED_ORDER))
+             src = cur;
+         else if (last)
+             src = last;
+         else
+             return;
+         if (cur->pict_type == AV_PICTURE_TYPE_B &&
+             picture_structure == PICT_FRAME &&
+             avctx->codec_id != AV_CODEC_ID_SVQ3) {
+             for (i = 0; i < AV_NUM_DATA_POINTERS; i++)
+                 offset[i] = 0;
+         } else {
+             offset[0]= y * src->linesize[0];
+             offset[1]=
+             offset[2]= (y >> vshift) * src->linesize[1];
+             for (i = 3; i < AV_NUM_DATA_POINTERS; i++)
+                 offset[i] = 0;
+         }
+         emms_c();
+         avctx->draw_horiz_band(avctx, src, offset,
+                                y, picture_structure, h);
+     }
+ }
Simple merge
@@@ -3015,71 -2305,16 +3015,18 @@@ skip_idct
  void ff_MPV_decode_mb(MpegEncContext *s, int16_t block[12][64]){
  #if !CONFIG_SMALL
      if(s->out_format == FMT_MPEG1) {
 -        MPV_decode_mb_internal(s, block, 1);
 +        if(s->avctx->lowres) MPV_decode_mb_internal(s, block, 1, 1);
 +        else                 MPV_decode_mb_internal(s, block, 0, 1);
      } else
  #endif
 -        MPV_decode_mb_internal(s, block, 0);
 +    if(s->avctx->lowres) MPV_decode_mb_internal(s, block, 1, 0);
 +    else                  MPV_decode_mb_internal(s, block, 0, 0);
  }
  
- /**
-  * @param h is the normal height, this will be reduced automatically if needed for the last row
-  */
- void ff_draw_horiz_band(AVCodecContext *avctx,
-                         AVFrame *cur, AVFrame *last,
-                         int y, int h, int picture_structure,
-                         int first_field, int low_delay)
- {
-     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
-     int vshift = desc->log2_chroma_h;
-     const int field_pic = picture_structure != PICT_FRAME;
-     if(field_pic){
-         h <<= 1;
-         y <<= 1;
-     }
-     h = FFMIN(h, avctx->height - y);
-     if(field_pic && first_field && !(avctx->slice_flags&SLICE_FLAG_ALLOW_FIELD)) return;
-     if (avctx->draw_horiz_band) {
-         AVFrame *src;
-         int offset[AV_NUM_DATA_POINTERS];
-         int i;
-         if (cur->pict_type == AV_PICTURE_TYPE_B || low_delay ||
-            (avctx->slice_flags & SLICE_FLAG_CODED_ORDER))
-             src = cur;
-         else if (last)
-             src = last;
-         else
-             return;
-         if (cur->pict_type == AV_PICTURE_TYPE_B &&
-             picture_structure == PICT_FRAME &&
-             avctx->codec_id != AV_CODEC_ID_SVQ3) {
-             for (i = 0; i < AV_NUM_DATA_POINTERS; i++)
-                 offset[i] = 0;
-         }else{
-             offset[0]= y * src->linesize[0];
-             offset[1]=
-             offset[2]= (y >> vshift) * src->linesize[1];
-             for (i = 3; i < AV_NUM_DATA_POINTERS; i++)
-                 offset[i] = 0;
-         }
-         emms_c();
-         avctx->draw_horiz_band(avctx, src, offset,
-                                y, picture_structure, h);
-     }
- }
  void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h)
  {
 -    ff_draw_horiz_band(s->avctx, &s->current_picture.f,
 -                       &s->last_picture.f, y, h, s->picture_structure,
 +    ff_draw_horiz_band(s->avctx, &s->current_picture_ptr->f,
 +                       &s->last_picture_ptr->f, y, h, s->picture_structure,
                         s->first_field, s->low_delay);
  }
  
@@@ -729,19 -710,9 +729,16 @@@ void ff_MPV_common_init_axp(MpegEncCont
  void ff_MPV_common_init_arm(MpegEncContext *s);
  void ff_MPV_common_init_ppc(MpegEncContext *s);
  void ff_clean_intra_table_entries(MpegEncContext *s);
- void ff_draw_horiz_band(AVCodecContext *avctx, AVFrame *cur, AVFrame *last,
-                         int y, int h, int picture_structure, int first_field,
-                         int low_delay);
  void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h);
  void ff_mpeg_flush(AVCodecContext *avctx);
 -void ff_print_debug_info(MpegEncContext *s, Picture *p);
 +
 +void ff_print_debug_info(MpegEncContext *s, Picture *p, AVFrame *pict);
 +void ff_print_debug_info2(AVCodecContext *avctx, Picture *p, AVFrame *pict, uint8_t *mbskip_table,
 +                         int *low_delay,
 +                         int mb_width, int mb_height, int mb_stride, int quarter_sample);
 +
 +int ff_mpv_export_qp_table(MpegEncContext *s, AVFrame *f, Picture *p, int qp_type);
 +
  void ff_write_quant_matrix(PutBitContext *pb, uint16_t *matrix);
  int ff_find_unused_picture(MpegEncContext *s, int shared);
  void ff_denoise_dct(MpegEncContext *s, int16_t *block);