Overview

Request 2118 (accepted)

- update internal ffmpeg to version 2.8

Submit package home:enzokiel:...hes:Multimedia / avidemux3 to package Multimedia / avidemux3

avidemux3.changes Changed
x
 
1
@@ -1,4 +1,9 @@
2
 -------------------------------------------------------------------
3
+Wed Sep 09 2015 - joerg.lorenzen@ki.tng.de
4
+
5
+- update internal ffmpeg to version 2.8
6
+
7
+-------------------------------------------------------------------
8
 Mon Jul 20 2015 - joerg.lorenzen@ki.tng.de
9
 
10
 - update internal ffmpeg to version 2.7.2
11
avidemux3.spec Changed
35
 
1
@@ -16,7 +16,7 @@
2
 #
3
 
4
 
5
-%define         ffmpeg_version 2.7.2
6
+%define         ffmpeg_version 2.8
7
 
8
 Name:           avidemux3
9
 Summary:        Graphical video editing and transcoding tool
10
@@ -33,6 +33,8 @@
11
 Source7:        libavcodec_x86_fmtconvert_init.c.patch
12
 Source8:        libavcodec_mpegvideo_enc.c.patch
13
 Source9:        libavcodec_mpeg12enc.c.patch
14
+Source10:       libavcodec_avcodec.h.patch
15
+Source11:       libavcodec_nvenc.patch
16
 Patch0:         avidemux-cmake-2.8.8.patch
17
 Patch1:         avidemux-linking.patch
18
 Patch2:         avidemux-x264_plugins.patch
19
@@ -272,11 +274,15 @@
20
 rm -f libavcodec_x86_fmtconvert_init.c.patch
21
 rm -f libavcodec_mpegvideo_enc.c.patch
22
 rm -f libavcodec_mpeg12enc.c.patch
23
+rm -f libavcodec_avcodec.h.patch
24
+rm -f libavcodec_nvenc.patch
25
 cp %{S:4} .
26
 cp %{S:5} .
27
 cp %{S:7} .
28
 cp %{S:8} .
29
 cp %{S:9} .
30
+cp %{S:10} .
31
+cp %{S:11} .
32
 pushd xvba
33
 rm -f xvba_support_from_xbmc_xvba.patch
34
 cp %{S:6} .
35
libavcodec_avcodec.h.patch Added
31
 
1
@@ -0,0 +1,29 @@
2
+--- libavcodec/avcodec.h.orig  2015-09-10 16:03:09.110337744 +0200
3
++++ libavcodec/avcodec.h   2015-09-10 16:03:09.132337918 +0200
4
+@@ -1008,6 +1008,10 @@
5
+ #define CODEC_FLAG2_DROP_FRAME_TIMECODE AV_CODEC_FLAG2_DROP_FRAME_TIMECODE
6
+ #define CODEC_FLAG2_IGNORE_CROP   AV_CODEC_FLAG2_IGNORE_CROP
7
+ 
8
++//MEANX: NEVER EVER USE CLOSED GOP ?
9
++#define CODEC_FLAG2_32_PULLDOWN   0x80000000
10
++// /MEANX
11
++
12
+ #define CODEC_FLAG2_CHUNKS        AV_CODEC_FLAG2_CHUNKS
13
+ #define CODEC_FLAG2_SHOW_ALL      AV_CODEC_FLAG2_SHOW_ALL
14
+ #define CODEC_FLAG2_EXPORT_MVS    AV_CODEC_FLAG2_EXPORT_MVS
15
+@@ -2579,6 +2583,7 @@
16
+      * - decoding: unused
17
+      */
18
+     int rc_buffer_size;
19
++    int rc_buffer_size_header;  /*< That one is set in the header MEANX*/
20
+ 
21
+     /**
22
+      * ratecontrol override, see RcOverride
23
+@@ -2602,6 +2607,7 @@
24
+      * - decoding: Set by user, may be overwritten by libavcodec.
25
+      */
26
+     int rc_max_rate;
27
++    int rc_max_rate_header; /*< That one is set in the header MEANX */
28
+ 
29
+     /**
30
+      * minimum bitrate
31
libavcodec_mpeg12enc.c.patch Changed
85
 
1
@@ -1,18 +1,22 @@
2
---- libavcodec/mpeg12enc.c.orig    2015-06-10 23:35:03.625383207 +0200
3
-+++ libavcodec/mpeg12enc.c 2015-06-10 23:35:03.661382526 +0200
4
-@@ -254,7 +254,7 @@
5
- 
6
+--- libavcodec/mpeg12enc.c.orig    2015-09-10 16:03:12.576365227 +0200
7
++++ libavcodec/mpeg12enc.c 2015-09-10 16:03:12.615365537 +0200
8
+@@ -256,6 +256,7 @@
9
          put_sbits(&s->pb, 12, s->width  & 0xFFF);
10
          put_sbits(&s->pb, 12, s->height & 0xFFF);
11
--
12
+ 
13
 +#if 0 // MEANX
14
          for (i = 1; i < 15; i++) {
15
              int64_t error = aspect_ratio.num * (1LL<<32) / aspect_ratio.den;
16
              if (s->codec_id == AV_CODEC_ID_MPEG1VIDEO || i <= 1)
17
-@@ -269,12 +269,41 @@
18
-                 s->aspect_ratio_info = i;
19
+@@ -271,11 +272,40 @@
20
              }
21
          }
22
+ 
23
+-        put_bits(&s->pb, 4, s->aspect_ratio_info);
24
+-        put_bits(&s->pb, 4, s->frame_rate_index);
25
+-
26
+-        if (s->avctx->rc_max_rate) {
27
+-            v = (s->avctx->rc_max_rate + 399) / 400;
28
 +#endif // MEANX
29
 +            // MEANX put_bits(&s->pb, 4, s->aspect_ratio_info);
30
 +            // MEANX put_bits(&s->pb, 4, s->frame_rate_index);
31
@@ -47,16 +51,10 @@
32
 +            if(s->avctx->rc_buffer_size_header) // MEANX we use header
33
 +            {
34
 +                vbv_buffer_size = s->avctx->rc_buffer_size_header;
35
- 
36
--        put_bits(&s->pb, 4, s->aspect_ratio_info);
37
--        put_bits(&s->pb, 4, s->frame_rate_index);
38
--
39
--        if (s->avctx->rc_max_rate) {
40
--            v = (s->avctx->rc_max_rate + 399) / 400;
41
              if (v > 0x3ffff && s->codec_id == AV_CODEC_ID_MPEG1VIDEO)
42
                  v = 0x3ffff;
43
          } else {
44
-@@ -324,7 +353,19 @@
45
+@@ -325,7 +355,19 @@
46
              put_bits(&s->pb, 3, s->avctx->profile); // profile
47
              put_bits(&s->pb, 4, s->avctx->level);   // level
48
  
49
@@ -77,7 +75,7 @@
50
              put_bits(&s->pb, 2, s->chroma_format);
51
              put_bits(&s->pb, 2, s->width  >> 12);
52
              put_bits(&s->pb, 2, s->height >> 12);
53
-@@ -425,6 +466,7 @@
54
+@@ -427,6 +469,7 @@
55
  
56
  void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number)
57
  {
58
@@ -85,7 +83,7 @@
59
      AVFrameSideData *side_data;
60
      mpeg1_encode_sequence_header(s);
61
  
62
-@@ -463,6 +505,46 @@
63
+@@ -465,6 +508,46 @@
64
  
65
      s->frame_pred_frame_dct = 1;
66
      if (s->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
67
@@ -132,7 +130,7 @@
68
          put_header(s, EXT_START_CODE);
69
          put_bits(&s->pb, 4, 8);                 /* pic ext */
70
          if (s->pict_type == AV_PICTURE_TYPE_P ||
71
-@@ -482,10 +564,14 @@
72
+@@ -484,10 +567,14 @@
73
  
74
          av_assert0(s->picture_structure == PICT_FRAME);
75
          put_bits(&s->pb, 2, s->picture_structure);
76
@@ -147,7 +145,7 @@
77
          /* XXX: optimize the generation of this flag with entropy measures */
78
          s->frame_pred_frame_dct = s->progressive_sequence;
79
  
80
-@@ -494,7 +580,8 @@
81
+@@ -496,7 +583,8 @@
82
          put_bits(&s->pb, 1, s->q_scale_type);
83
          put_bits(&s->pb, 1, s->intra_vlc_format);
84
          put_bits(&s->pb, 1, s->alternate_scan);
85
libavcodec_mpegvideo_enc.c.patch Changed
36
 
1
@@ -1,12 +1,12 @@
2
---- libavcodec/mpegvideo_enc.c.orig    2015-06-10 20:53:04.066303738 +0200
3
-+++ libavcodec/mpegvideo_enc.c 2015-06-10 20:57:27.692337620 +0200
4
-@@ -469,14 +469,14 @@
5
+--- libavcodec/mpegvideo_enc.c.orig    2015-09-10 21:42:19.055613989 +0200
6
++++ libavcodec/mpegvideo_enc.c 2015-09-10 21:42:19.096613316 +0200
7
+@@ -498,14 +498,14 @@
8
                 "Warning vbv_delay will be set to 0xFFFF (=VBR) as the "
9
                 "specified vbv buffer is too large for the given bitrate!\n");
10
      }
11
 -
12
 +#if 0 // MEANX
13
-     if ((s->avctx->flags & CODEC_FLAG_4MV) && s->codec_id != AV_CODEC_ID_MPEG4 &&
14
+     if ((s->avctx->flags & AV_CODEC_FLAG_4MV) && s->codec_id != AV_CODEC_ID_MPEG4 &&
15
          s->codec_id != AV_CODEC_ID_H263 && s->codec_id != AV_CODEC_ID_H263P &&
16
          s->codec_id != AV_CODEC_ID_FLV1) {
17
          av_log(avctx, AV_LOG_ERROR, "4MV not supported by codec\n");
18
@@ -17,7 +17,7 @@
19
      if (s->obmc && s->avctx->mb_decision != FF_MB_DECISION_SIMPLE) {
20
          av_log(avctx, AV_LOG_ERROR,
21
                 "OBMC is only supported with simple mb decision\n");
22
-@@ -568,7 +568,7 @@
23
+@@ -597,7 +597,7 @@
24
          av_log(avctx, AV_LOG_ERROR, "interlacing not supported by codec\n");
25
          return -1;
26
      }
27
@@ -26,7 +26,7 @@
28
      // FIXME mpeg2 uses that too
29
      if (s->mpeg_quant && (   s->codec_id != AV_CODEC_ID_MPEG4
30
                            && s->codec_id != AV_CODEC_ID_MPEG2VIDEO)) {
31
-@@ -576,7 +576,7 @@
32
+@@ -605,7 +605,7 @@
33
                 "mpeg2 style quantization not supported by codec\n");
34
          return -1;
35
      }
36
libavcodec_nvenc.patch Added
145
 
1
@@ -0,0 +1,143 @@
2
+--- libavcodec/nvenc.c.orig    2015-09-10 16:03:16.151393593 +0200
3
++++ libavcodec/nvenc.c 2015-09-10 16:03:16.198393966 +0200
4
+@@ -960,19 +960,19 @@
5
+ 
6
+         switch (avctx->pix_fmt) {
7
+         case AV_PIX_FMT_YUV420P:
8
+-            allocSurf.bufferFmt = NV_ENC_BUFFER_FORMAT_YV12_PL;
9
+-            break;
10
++            //allocSurf.bufferFmt = NV_ENC_BUFFER_FORMAT_YV12_PL;
11
++            //break;
12
+ 
13
+         case AV_PIX_FMT_NV12:
14
+             allocSurf.bufferFmt = NV_ENC_BUFFER_FORMAT_NV12_PL;
15
+             break;
16
+ 
17
+-        case AV_PIX_FMT_YUV444P:
18
+-            allocSurf.bufferFmt = NV_ENC_BUFFER_FORMAT_YUV444_PL;
19
+-            break;
20
++        //case AV_PIX_FMT_YUV444P:
21
++            //allocSurf.bufferFmt = NV_ENC_BUFFER_FORMAT_YUV444_PL;
22
++            //break;
23
+ 
24
+         default:
25
+-            av_log(avctx, AV_LOG_FATAL, "Invalid input pixel format\n");
26
++            av_log(avctx, AV_LOG_FATAL, "NVENC: Invalid input pixel format\n");
27
+             res = AVERROR(EINVAL);
28
+             goto error;
29
+         }
30
+@@ -1198,6 +1198,28 @@
31
+ 
32
+     return res;
33
+ }
34
++/**
35
++        MEANX
36
++*/
37
++static void interleave_nv12(unsigned char *dest, int dest_stride,unsigned char *u,int u_stride,unsigned char *v,int v_stride,int width, int height)
38
++{
39
++        int x,y;
40
++        unsigned char *d;
41
++        unsigned char *pu;
42
++        unsigned char *pv;
43
++        for(y=0;y<height;y++)
44
++        {
45
++                d=dest;dest+=dest_stride;
46
++                pu=u;u+=u_stride;
47
++                pv=v;v+=v_stride;
48
++                for(x=0;x<width;x++)
49
++                {
50
++                        *(d++)=*(pu++);
51
++                        *(d++)=*(pv++);
52
++                }
53
++
54
++        }
55
++} 
56
+ 
57
+ static int nvenc_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
58
+     const AVFrame *frame, int *got_packet)
59
+@@ -1235,62 +1257,33 @@
60
+         if (nv_status != NV_ENC_SUCCESS) {
61
+             av_log(avctx, AV_LOG_ERROR, "Failed locking nvenc input buffer\n");
62
+             return 0;
63
+-        }
64
+-
65
+-        if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) {
66
+-            uint8_t *buf = lockBufferParams.bufferDataPtr;
67
+-
68
+-            av_image_copy_plane(buf, lockBufferParams.pitch,
69
+-                frame->data[0], frame->linesize[0],
70
+-                avctx->width, avctx->height);
71
+-
72
+-            buf += inSurf->height * lockBufferParams.pitch;
73
+-
74
+-            av_image_copy_plane(buf, lockBufferParams.pitch >> 1,
75
+-                frame->data[2], frame->linesize[2],
76
+-                avctx->width >> 1, avctx->height >> 1);
77
+-
78
+-            buf += (inSurf->height * lockBufferParams.pitch) >> 2;
79
++        }  
80
++        { 
81
++        uint8_t *buf = lockBufferParams.bufferDataPtr;
82
+ 
83
+-            av_image_copy_plane(buf, lockBufferParams.pitch >> 1,
84
+-                frame->data[1], frame->linesize[1],
85
+-                avctx->width >> 1, avctx->height >> 1);
86
+-        } else if (avctx->pix_fmt == AV_PIX_FMT_NV12) {
87
+-            uint8_t *buf = lockBufferParams.bufferDataPtr;
88
+-
89
+-            av_image_copy_plane(buf, lockBufferParams.pitch,
90
++        av_image_copy_plane(buf, lockBufferParams.pitch,
91
+                 frame->data[0], frame->linesize[0],
92
+                 avctx->width, avctx->height);
93
++// MEANX : We accept YV12 and interleave while copying, it saves us one intermediate image buffer
94
++        buf += inSurf->height * lockBufferParams.pitch;
95
++        switch(avctx->pix_fmt)
96
++        {
97
++                case AV_PIX_FMT_YUV420P:
98
++                        // Interleave U & V to NV12
99
++                        interleave_nv12(buf, lockBufferParams.pitch,frame->data[1],frame->linesize[1],frame->data[2],frame->linesize[2],avctx->width>>1, avctx->height>>1); 
100
++                        break;
101
++
102
++                case AV_PIX_FMT_NV12:
103
++                        av_image_copy_plane(buf, lockBufferParams.pitch,
104
++                                frame->data[1], frame->linesize[1],
105
++                                avctx->width, avctx->height >> 1);
106
++                        break;
107
++                default:
108
++                        av_log(avctx, AV_LOG_FATAL, "NVENC: Invalid pixel format!\n");
109
++                        return AVERROR(EINVAL);
110
+ 
111
+-            buf += inSurf->height * lockBufferParams.pitch;
112
+-
113
+-            av_image_copy_plane(buf, lockBufferParams.pitch,
114
+-                frame->data[1], frame->linesize[1],
115
+-                avctx->width, avctx->height >> 1);
116
+-        } else if (avctx->pix_fmt == AV_PIX_FMT_YUV444P) {
117
+-            uint8_t *buf = lockBufferParams.bufferDataPtr;
118
+-
119
+-            av_image_copy_plane(buf, lockBufferParams.pitch,
120
+-                frame->data[0], frame->linesize[0],
121
+-                avctx->width, avctx->height);
122
+-
123
+-            buf += inSurf->height * lockBufferParams.pitch;
124
+-
125
+-            av_image_copy_plane(buf, lockBufferParams.pitch,
126
+-                frame->data[1], frame->linesize[1],
127
+-                avctx->width, avctx->height);
128
+-
129
+-            buf += inSurf->height * lockBufferParams.pitch;
130
+-
131
+-            av_image_copy_plane(buf, lockBufferParams.pitch,
132
+-                frame->data[2], frame->linesize[2],
133
+-                avctx->width, avctx->height);
134
+-        } else {
135
+-            av_log(avctx, AV_LOG_FATAL, "Invalid pixel format!\n");
136
+-            return AVERROR(EINVAL);
137
+-        }
138
+-
139
+-        nv_status = p_nvenc->nvEncUnlockInputBuffer(ctx->nvencoder, inSurf->input_surface);
140
++       }
141
++       nv_status = p_nvenc->nvEncUnlockInputBuffer(ctx->nvencoder, inSurf->input_surface);
142
+         if (nv_status != NV_ENC_SUCCESS) {
143
+             av_log(avctx, AV_LOG_FATAL, "Failed unlocking input buffer!\n");
144
+             return AVERROR_EXTERNAL;
145
ffmpeg-2.7.2.tar.bz2 -> ffmpeg-2.8.tar.bz2 Changed
Refresh

No build results available

Refresh

No rpmlint results available

Request History
enzokiel's avatar

enzokiel created request over 9 years ago

- update internal ffmpeg to version 2.8


enzokiel's avatar

enzokiel accepted request over 9 years ago

OK.