aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/msmpeg4.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-05-21 23:13:57 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-05-21 23:13:57 +0000
commit92ba5ffbb5fe072a3bdf37f87ec1443ee1af6744 (patch)
treec2a0e3c339c15415f90df21d5ec32fafb99f9ca0 /libavcodec/msmpeg4.c
parentddad77fadeecbe99aaf9e283310b774aa894694d (diff)
downloadffmpeg-92ba5ffbb5fe072a3bdf37f87ec1443ee1af6744.tar.gz
workaround dc_scale bug in old ffmpeg msmpeg4v3 encoder (set workaround_bugs=1 for this)
Originally committed as revision 561 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/msmpeg4.c')
-rw-r--r--libavcodec/msmpeg4.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c
index 2809aee467..79fd5f8c20 100644
--- a/libavcodec/msmpeg4.c
+++ b/libavcodec/msmpeg4.c
@@ -15,11 +15,14 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * msmpeg4v2 stuff by Michael Niedermayer <michaelni@gmx.at>
*/
#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
+
/*
* You can also call this codec : MPEG4 with a twist !
*
@@ -407,26 +410,20 @@ void msmpeg4_encode_mb(MpegEncContext * s,
}
}
-
-#if 0
-/* identical to mpeg4 for msmpeg4v3 but not msmpeg4v2 */
-void msmpeg4_dc_scale(MpegEncContext * s)
+/* old ffmpeg msmpeg4v3 mode */
+void ff_old_msmpeg4_dc_scale(MpegEncContext * s)
{
- if (s->qscale < 5 || s->msmpeg4_version==2){
+ if (s->qscale < 5){
s->y_dc_scale = 8;
s->c_dc_scale = 8;
}else if (s->qscale < 9){
s->y_dc_scale = 2 * s->qscale;
s->c_dc_scale = (s->qscale + 13)>>1;
- }else if(s->qscale < 25){
+ }else{
s->y_dc_scale = s->qscale + 8;
s->c_dc_scale = (s->qscale + 13)>>1;
- }else{
- s->y_dc_scale = 2 * s->qscale - 16;
- s->c_dc_scale = s->qscale - 6;
}
}
-#endif
/* dir = 0: left, dir = 1: top prediction */
static int msmpeg4_pred_dc(MpegEncContext * s, int n,