[Ffmpeg-devel] Re: Compilation poblem and fix on 2007-03-06 trunk (Tatu Kilappa)

larry.sdk larry.sdk
Fri Mar 9 01:58:34 CET 2007


As the MS VC do not support declaration array with varible size,  all of the source code must be modified with _alloc(). And below is and example in the dsputils.c:

DECLARE_ALIGNED_8 (uint64_t, aligned_bak[stride]);

replaced it by:

 uint64_t *aligned_bak = (uint64_t *)_alloca(sizeof(uint64_t)*stride);

BR,

larry.sdk
larry.sdk at gmail.com

Tel:028-83207305
Mobile:13568811055
----- Original Message ----- 
From: <ffmpeg-devel-request at mplayerhq.hu>
To: <ffmpeg-devel at mplayerhq.hu>
Sent: Thursday, March 08, 2007 6:54 PM
Subject: ffmpeg-devel Digest, Vol 24, Issue 95


> Send ffmpeg-devel mailing list submissions to
> ffmpeg-devel at mplayerhq.hu
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
> or, via email, send a message with subject or body 'help' to
> ffmpeg-devel-request at mplayerhq.hu
> 
> You can reach the person managing the list at
> ffmpeg-devel-owner at mplayerhq.hu
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ffmpeg-devel digest..."
> 
> 
> Today's Topics:
> 
>    1. Compilation poblem and fix on 2007-03-06 trunk (Tatu Kilappa)
>    2. Question about img_convert() and avcodec_decode_video
>       (xiaobof at juno.com)
>    3. Re: [PATCH] init wb codec on definition (Panagiotis Issaris)
>    4. Re: [PATCH] cosmetics in amr.c file (Panagiotis Issaris)
>    5. Re: [PATCH] remove unneeded casts from amr.c (Panagiotis Issaris)
>    6. Re: encode_superframe Assertion failure in WMA encoder
>       (Michael Niedermayer)
>    7. Re: [PATCH] use av_q2d() instead (Michael Niedermayer)
>    8. Re: Compilation poblem and fix on 2007-03-06 trunk (M?ns Rullg?rd)
>    9. Re: WMA encoding and Windows Media Player for Mac OS X
>       (Michael Niedermayer)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Tue, 6 Mar 2007 20:22:39 +0200
> From: Tatu Kilappa <trilkk at iki.fi>
> Subject: [Ffmpeg-devel] Compilation poblem and fix on 2007-03-06 trunk
> To: ffmpeg-devel at mplayerhq.hu
> Message-ID: <20070306202239.19d13693.trilkk at iki.fi>
> Content-Type: text/plain; charset="us-ascii"
> 
> I noticed a slight problem in the compilation of today's ffmpeg on C++
> programs. Since C99 integer constant macros are not enabled by default,
> including avcodec.h will cause compilation to fail with a report
> to a missing identifier INT64_C.
> 
> grepping through /usr/include it becomes obvious that INT64_C is only
> defined within stdint.h, which is not specifically included at any
> point in libavcodec sources. My proposal for the fix would be following:
> 
> 1) Add a check for stdint.h in configure.
> 2) Before including anything else in avcodec.h, include stdint.h with
> __STDC_CONSTANT_MACROS enabled so as to ensure that they're defined no
> matter what.
> 
> The patches included here accomplish that.
> 
> -- 
> -Tatu Kilappa <trilkk at iki.fi>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: configure.patch
> Type: text/x-diff
> Size: 377 bytes
> Desc: not available
> Url : http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070306/83c8081d/configure-0001.bin
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: libavcodec_avcodec.h.patch
> Type: text/x-diff
> Size: 465 bytes
> Desc: not available
> Url : http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070306/83c8081d/libavcodec_avcodec.h-0001.bin
> 
> ------------------------------
> 
> Message: 2
> Date: Wed, 7 Mar 2007 21:03:27 GMT
> From: "xiaobof at juno.com" <xiaobof at juno.com>
> Subject: [Ffmpeg-devel] Question about img_convert() and
> avcodec_decode_video
> To: ffmpeg-devel at mplayerhq.hu
> Message-ID: <20070307.130355.15626.2096848 at webmail04.nyc.untd.com>
> Content-Type: text/plain
> 
> Hi, 
> 
> 
> I am trying to decode a video file and save it to PPM file. I am using
> the sample_encoding.cpp from
> http://arrozcru.no-ip.org/ffmpeg_forum/viewtopic.php?t=15.
> 
> However the newest version of ffmpeg seems not supporting img_convert()
> any more. It has link error: "error LNK2001: unresolved external symbol
> "int __cdecl img_convert(struct AVPicture *,int,struct AVPicture const
> *,int,int,int)" (?img_convert@@$$J0YAHPAUAVPicture@@HPBU1 at HHH at Z)"
> 
> Is there any other function I can use to replace img_convert()? Do I
> have to do img_convert?
> 
> What pix_fmt will the AVFrame be after avcodec_decode_video() funtion?
> 
> Currently without img_convert(), the images are all grey and the width
> is 1/3 of the orginal width.
> 
> Thank you
> -Bo
> 
> 
> 
> ________________________________________________________________________
> FREE Reminder Service - NEW from AmericanGreetings.com
> Click HERE and never forget a Birthday or Anniversary again!
> http://track.juno.com/s/lc?s=197335&u=http://www.americangreetings.com/products/online_calendar.pd?c=uol5752
> 
> 
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Thu, 08 Mar 2007 11:07:33 +0100
> From: Panagiotis Issaris <takis.issaris at uhasselt.be>
> Subject: Re: [Ffmpeg-devel] [PATCH] init wb codec on definition
> To: FFmpeg development discussions and patches
> <ffmpeg-devel at mplayerhq.hu>
> Message-ID: <45EFE065.2030600 at uhasselt.be>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi
> 
> Michael Niedermayer schreef:
> > Hi
> > 
> > On Wed, Mar 07, 2007 at 10:19:22PM +0100, Benoit Fouet wrote:
> >> Hi,
> >>
> >> in amr.c, only the amr_wb_encode_frame function initializes its context
> >> on a different line as it defines it. This patch just move the
> >> initialization on context definition.
> > 
> > looks ok
> > 
> > [...]
> Applied.
> 
> With friendly regards,
> Takis
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iD8DBQFF7+Bk9kOxLuzz4CkRAkZgAJ9aq/0U3zJQzBNmnwCOFVufrwiwYACdG1HB
> bkCUk+DassuAgCVmvN5muWA=
> =7vmE
> -----END PGP SIGNATURE-----
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Thu, 08 Mar 2007 11:11:49 +0100
> From: Panagiotis Issaris <takis.issaris at uhasselt.be>
> Subject: Re: [Ffmpeg-devel] [PATCH] cosmetics in amr.c file
> To: FFmpeg development discussions and patches
> <ffmpeg-devel at mplayerhq.hu>
> Message-ID: <45EFE165.3060003 at uhasselt.be>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Michael Niedermayer schreef:
> > Hi
> > 
> > On Wed, Mar 07, 2007 at 10:22:54PM +0100, Benoit Fouet wrote:
> >> Hi,
> >>
> >> this patch is cosmetics in amr.c
> >> it:
> >>  - removes carriage returns where (i find it) unneeded
> >>  - don't break lines when defining variables
> >>  - break line between variable definition and the rest of the code
> >>
> >> it is mainly useless, and just tries to have a consistant code...
> > 
> > looks ok
> > 
> > [...]
> Applied.
> 
> With friendly regards,
> Takis
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iD8DBQFF7+Fl9kOxLuzz4CkRAlhBAJ9/pjhHnGkaAW2eEdwiIGMW9DdhvACfQwv7
> yAJowQ3xFny06WN3wdnD2Y0=
> =ZrHm
> -----END PGP SIGNATURE-----
> 
> 
> ------------------------------
> 
> Message: 5
> Date: Thu, 08 Mar 2007 11:22:47 +0100
> From: Panagiotis Issaris <takis.issaris at uhasselt.be>
> Subject: Re: [Ffmpeg-devel] [PATCH] remove unneeded casts from amr.c
> To: FFmpeg development discussions and patches
> <ffmpeg-devel at mplayerhq.hu>
> Message-ID: <45EFE3F7.8020100 at uhasselt.be>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Michael Niedermayer schreef:
> > Hi
> > 
> > On Wed, Mar 07, 2007 at 10:46:13PM +0100, Benoit Fouet wrote:
> >> Hi,
> >>
> >> following advice from M?ns in [PATCH] init wb codec on definition
> >> thread, the following patch remove useless casts.
> > 
> > looks ok
> > 
> > [...]
> Applied.
> 
> With friendly regards,
> Takis
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iD8DBQFF7+P39kOxLuzz4CkRAu6sAJ9bG3UvyAAf0xBODAwqOR1gkkxv4gCeNinn
> CpXUw0a2vuzsSNL5lf6e07g=
> =AxAo
> -----END PGP SIGNATURE-----
> 
> 
> ------------------------------
> 
> Message: 6
> Date: Thu, 8 Mar 2007 11:23:21 +0100
> From: Michael Niedermayer <michaelni at gmx.at>
> Subject: Re: [Ffmpeg-devel] encode_superframe Assertion failure in WMA
> encoder
> To: FFmpeg development discussions and patches
> <ffmpeg-devel at mplayerhq.hu>
> Message-ID: <20070308102321.GA25795 at MichaelsNB>
> Content-Type: text/plain; charset="us-ascii"
> 
> Hi
> 
> On Wed, Mar 07, 2007 at 06:20:57PM -0600, Bob Joneson wrote:
> > Trying to transcode an mpeg4/mp3 avi to wmv. 
> > 
> > ffmpeg -i test.avi -vcodec wmv2 -acodec wmav2 -f asf test.wmv [works fine, but it encodes the video at the default 200kb / second]
> > 
> > If I try to specify an audio or video bitrate (-b / -ab) I'm greeted with the following:
> > 
> > ffmpeg: wmaenc.c:376: encode_superframe: Assertion `i>0' failed.
> 
> fixed
> 
> [...]
> -- 
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> There will always be a question for which you do not know the correct awnser.
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: not available
> Type: application/pgp-signature
> Size: 189 bytes
> Desc: not available
> Url : http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070308/5c2d6445/attachment-0001.pgp
> 
> ------------------------------
> 
> Message: 7
> Date: Thu, 8 Mar 2007 11:30:05 +0100
> From: Michael Niedermayer <michaelni at gmx.at>
> Subject: Re: [Ffmpeg-devel] [PATCH] use av_q2d() instead
> To: FFmpeg development discussions and patches
> <ffmpeg-devel at mplayerhq.hu>
> Message-ID: <20070308103004.GB25795 at MichaelsNB>
> Content-Type: text/plain; charset="us-ascii"
> 
> Hi
> 
> On Thu, Mar 08, 2007 at 01:26:25PM +0800, Limin Wang wrote:
> > Hi,
> > 
> > please review the patch.
> > 
> > 
> > Thanks,
> > Limin
> 
> [...]
> > @@ -1079,9 +1079,7 @@
> >                          goto discard_packet;
> >                      }
> >                      if (ist->st->codec->time_base.num != 0) {
> > -                        ist->next_pts += ((int64_t)AV_TIME_BASE *
> > -                                          ist->st->codec->time_base.num) /
> > -                            ist->st->codec->time_base.den;
> > +                        ist->next_pts += ((int64_t)AV_TIME_BASE * av_q2d(ist->st->codec->time_base));
> 
> replacing exact integer calculations by approximations is not accpetable
> 
> 
> [...]
> -- 
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> I count him braver who overcomes his desires than him who conquers his
> enemies for the hardest victory is over self. -- Aristotle
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: not available
> Type: application/pgp-signature
> Size: 189 bytes
> Desc: not available
> Url : http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070308/9e12098e/attachment-0001.pgp
> 
> ------------------------------
> 
> Message: 8
> Date: Thu, 8 Mar 2007 10:43:18 -0000 (GMT)
> From: M?ns Rullg?rd <mans at mansr.com>
> Subject: Re: [Ffmpeg-devel] Compilation poblem and fix on 2007-03-06
> trunk
> To: "FFmpeg development discussions and patches"
> <ffmpeg-devel at mplayerhq.hu>
> Message-ID: <12530.194.202.59.51.1173350598.squirrel at mail.mansr.com>
> Content-Type: text/plain;charset=utf-8
> 
> 
> Tatu Kilappa said:
> > I noticed a slight problem in the compilation of today's ffmpeg on C++
> > programs. Since C99 integer constant macros are not enabled by default,
> > including avcodec.h will cause compilation to fail with a report
> > to a missing identifier INT64_C.
> >
> > grepping through /usr/include it becomes obvious that INT64_C is only
> > defined within stdint.h, which is not specifically included at any
> > point in libavcodec sources. My proposal for the fix would be following:
> 
> We #include <inttypes.h>, which is required to include stdint.h.
> 
> > 1) Add a check for stdint.h in configure.
> 
> Pointless.  We require it.
> 
> > 2) Before including anything else in avcodec.h, include stdint.h with
> > __STDC_CONSTANT_MACROS enabled so as to ensure that they're defined no
> > matter what.
> >
> > The patches included here accomplish that.
> 
> FFmpeg and its libraries are written in C, and can be built and used in a
> conforming C environment.  If you want to use it from another language, you
> must take whatever steps are needed to access C libraries from that language.
> 
> In the case of C++, this apparently includes defining the macro you mention.
> Other languages, e.g. Fortran, have different requirements entirely.
> 
> Furthermore, your patch does the wrong thing, and doesn't even do that right.
> The config.h macros are only available when building FFmpeg and must not be
> used in the public headers.
> 
> Patch rejected.
> 
> -- 
> M??ns Rullg??rd
> mans at mansr.com
> 
> 
> ------------------------------
> 
> Message: 9
> Date: Thu, 8 Mar 2007 11:51:47 +0100
> From: Michael Niedermayer <michaelni at gmx.at>
> Subject: Re: [Ffmpeg-devel] WMA encoding and Windows Media Player for
> Mac OS X
> To: FFmpeg development discussions and patches
> <ffmpeg-devel at mplayerhq.hu>
> Message-ID: <20070308105146.GC25795 at MichaelsNB>
> Content-Type: text/plain; charset="us-ascii"
> 
> Hi
> 
> On Wed, Mar 07, 2007 at 10:33:22PM -0600, Tyler Loch wrote:
> > >changing
> > >            int64_t left=  st2->time_base.num * (int64_t)st - 
> > >>time_base.den;
> > >            int64_t right= st ->time_base.num * (int64_t)st2- 
> > >>time_base.den;
> > >            if((*next_point)->pkt.dts * left > pkt->dts * right) // 
> > >FIXME this can overflow
> > >to something like
> > >            int64_t left=  st2->time_base.num * (int64_t)st - 
> > >>time_base.den;
> > >            int64_t right= st ->time_base.num * (int64_t)st2- 
> > >>time_base.den;
> > >            int64_t leftdts= (*next_point)->pkt.dts;
> > >if(st2->codec.codec_type == CODEC_TYPE_AUDIO)
> > >    leftts +-= some constant;
> > >            if(leftdts * left > pkt->dts * right) //FIXME this can  
> > >overflow
> > 
> > Well, how 'bout that...
> > I had some trouble with st2->codec->codec_type detection doing much,  
> > but this code works FLAWLESSLY on every WMV player I have access to  
> > right now:
> > 
> >             int64_t left=  st2->time_base.num * (int64_t)st - 
> > >time_base.den;
> >             int64_t right= st ->time_base.num * (int64_t)st2- 
> > >time_base.den;
> >             int64_t leftdts = 0;
> >             if(leftdts * left > pkt->dts * right) //FIXME this can  
> > overflow
> 
> well this disables sorting of the packets, or in other words they stay
> in exactly the order they where on the input side, and the input can
> be ordered arbitrary so while this is a big step forward, it seems
> that purely ordering packets differently helps it doesnt give me
> any hint on how to order the packets ...
> 
> maybe the patch below with some other (positive or negative) value 
> for 500 will work?
> 
> Index: utils.c
> ===================================================================
> --- utils.c (revision 8273)
> +++ utils.c (working copy)
> @@ -2222,7 +2222,14 @@
>              AVStream *st2= s->streams[ (*next_point)->pkt.stream_index];
>              int64_t left=  st2->time_base.num * (int64_t)st ->time_base.den;
>              int64_t right= st ->time_base.num * (int64_t)st2->time_base.den;
> -            if((*next_point)->pkt.dts * left > pkt->dts * right) //FIXME this can overflow
> +            int64_t left_dts = (*next_point)->pkt.dts;
> +            int64_t right_dts= pkt->dts;
> +int delay= 500;
> +if(st2->codec->codec_type == CODEC_TYPE_AUDIO)
> +    left_dts  -= delay / av_q2d(st2->time_base) / 1000;
> +if(st ->codec->codec_type == CODEC_TYPE_AUDIO)
> +    right_dts -= delay / av_q2d(st ->time_base) / 1000;
> +            if(left_dts * left > right_dts * right) //FIXME this can overflow
>                  break;
>              next_point= &(*next_point)->next;
>          }
> 
> 
> [...]
> -- 
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> No great genius has ever existed without some touch of madness. -- Aristotle
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: not available
> Type: application/pgp-signature
> Size: 189 bytes
> Desc: not available
> Url : http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070308/5c7db5af/attachment.pgp
> 
> ------------------------------
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
> 
> End of ffmpeg-devel Digest, Vol 24, Issue 95
> ********************************************



More information about the ffmpeg-devel mailing list