Mercurial > mplayer.hg
view libass/ass_font.h @ 32860:77dd2bb3fd02
Make sure we don't store the same stats twice by nulling the first byte of the stats_out string once we have written it.
I've verified that this is necessary, without it at normally at least the last stats line is duplicated, it could also happen when we call encode_video more often due to encoder delay as Reimar noted.
Sample encode was with default -ovc lavc -lavcopts vpass=1:
--- pass1stats.log 2011-02-21 15:44:42.314259000 +0100
+++ pass1stats.log.dedup_patch 2011-02-21 15:41:51.262778000 +0100
@@ -6421,4 +6421,3 @@
in:6420 out:6420 type:2 q:239 itex:0 ptex:15905 mv:441 misc:1911 fcode:1 bcode:1 mc-var:989 var:350603 icount:0 skipcount:373 hbits:55;
in:6421 out:6421 type:2 q:247 itex:0 ptex:13020 mv:422 misc:1863 fcode:1 bcode:1 mc-var:953 var:352607 icount:0 skipcount:379 hbits:55;
in:6422 out:6422 type:2 q:252 itex:0 ptex:3162 mv:258 misc:1293 fcode:1 bcode:1 mc-var:837 var:352872 icount:0 skipcount:449 hbits:55;
-in:6422 out:6422 type:2 q:252 itex:0 ptex:3162 mv:258 misc:1293 fcode:1 bcode:1 mc-var:837 var:352872 icount:0 skipcount:449 hbits:55;
author | ranma |
---|---|
date | Mon, 21 Feb 2011 14:52:25 +0000 |
parents | e64df5862cea |
children | 88eebbbbd6a0 |
line wrap: on
line source
/* * Copyright (C) 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com> * * This file is part of libass. * * libass is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * libass 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 General Public License for more details. * * You should have received a copy of the GNU General Public License along * with libass; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef LIBASS_FONT_H #define LIBASS_FONT_H #include <stdint.h> #include <ft2build.h> #include FT_GLYPH_H #include "ass.h" #include "ass_types.h" #define ASS_FONT_MAX_FACES 10 #define DECO_UNDERLINE 1 #define DECO_STRIKETHROUGH 2 typedef struct { char *family; unsigned bold; unsigned italic; int treat_family_as_pattern; int vertical; // @font vertical layout } ASS_FontDesc; typedef struct { ASS_FontDesc desc; ASS_Library *library; FT_Library ftlibrary; FT_Face faces[ASS_FONT_MAX_FACES]; int n_faces; double scale_x, scale_y; // current transform FT_Vector v; // current shift double size; } ASS_Font; // FIXME: passing the hashmap via a void pointer is very ugly. ASS_Font *ass_font_new(void *font_cache, ASS_Library *library, FT_Library ftlibrary, void *fc_priv, ASS_FontDesc *desc); void ass_font_set_transform(ASS_Font *font, double scale_x, double scale_y, FT_Vector *v); void ass_font_set_size(ASS_Font *font, double size); void ass_font_get_asc_desc(ASS_Font *font, uint32_t ch, int *asc, int *desc); FT_Glyph ass_font_get_glyph(void *fontconfig_priv, ASS_Font *font, uint32_t ch, ASS_Hinting hinting, int flags); FT_Vector ass_font_get_kerning(ASS_Font *font, uint32_t c1, uint32_t c2); void ass_font_free(ASS_Font *font); void fix_freetype_stroker(FT_OutlineGlyph glyph, int border_x, int border_y); #endif /* LIBASS_FONT_H */