]> git.sesse.net Git - x264/commitdiff
Remove --visualize option.
authorAnton Mitrofanov <BugMaster@narod.ru>
Sun, 27 Oct 2013 15:27:23 +0000 (19:27 +0400)
committerFiona Glaser <fiona@x264.com>
Wed, 30 Oct 2013 20:02:28 +0000 (13:02 -0700)
It probably wasn't used or maintained for last few years.

12 files changed:
AUTHORS
Makefile
common/common.c
common/common.h
common/display-x11.c [deleted file]
common/display.h [deleted file]
common/visualize.c [deleted file]
common/visualize.h [deleted file]
configure
encoder/encoder.c
x264.c
x264.h

diff --git a/AUTHORS b/AUTHORS
index 60ffb621f96b2294e9b715cf17f340dbb2d0b82f..680987b5b64d6143393f068db66028e536b06e3b 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -99,7 +99,3 @@ N: Radek Czyz
 E: radoslaw AT syskin DOT cjb DOT net
 D: Cached motion compensation
 
-N: Tuukka Toivonen
-E: tuukkat AT ee DOT oulu DOT fi
-D: Visualization
-
index 9bf564fa224c705326aa1b498d3daffe468a3967..a2bc0dc95460967ff617ec38da2b6ae4218cbaa2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -73,11 +73,6 @@ ifneq ($(findstring HAVE_LSMASH 1, $(CONFIG)),)
 SRCCLI += output/mp4_lsmash.c
 endif
 
-# Visualization sources
-ifneq ($(findstring HAVE_VISUALIZE 1, $(CONFIG)),)
-SRCS   += common/visualize.c common/display-x11.c
-endif
-
 # MMX/SSE optims
 ifneq ($(AS),)
 X86SRC0 = const-a.asm cabac-a.asm dct-a.asm deblock-a.asm mc-a.asm \
index 467db3e472dbe70a475a55cc5dcf4c02e0f14035..f24890f9fda2b296405c66628f40818e2fbe0178 100644 (file)
@@ -881,10 +881,6 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
     }
     OPT("log")
         p->i_log_level = atoi(value);
-#if HAVE_VISUALIZE
-    OPT("visualize")
-        p->b_visualize = atobool(value);
-#endif
     OPT("dump-yuv")
         p->psz_dump_yuv = strdup(value);
     OPT2("analyse", "partitions")
index 9e05525c40466e8c0981853606c501b4c04dcf87..d18b715e1fc16a01db0ce29779cbce13b9a43ae6 100644 (file)
@@ -967,9 +967,6 @@ struct x264_t
     x264_deblock_function_t loopf;
     x264_bitstream_function_t bsf;
 
-#if HAVE_VISUALIZE
-    struct visualize_t *visualize;
-#endif
     x264_lookahead_t *lookahead;
 
 #if HAVE_OPENCL
diff --git a/common/display-x11.c b/common/display-x11.c
deleted file mode 100644 (file)
index 17c02a6..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-/*****************************************************************************
- * display-x11.c: x11 interface
- *****************************************************************************
- * Copyright (C) 2005-2013 x264 project
- *
- * Authors: Tuukka Toivonen <tuukkat@ee.oulu.fi>
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
- *
- * This program is also available under a commercial proprietary license.
- * For more information, contact us at licensing@x264.com.
- *****************************************************************************/
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "common.h"
-#include "display.h"
-
-static long event_mask = ConfigureNotify|ExposureMask|KeyPressMask|ButtonPressMask|StructureNotifyMask|ResizeRedirectMask;
-
-static Display *disp_display = NULL;
-static struct disp_window
-{
-    int init;
-    Window window;
-} disp_window[10];
-
-static inline void disp_chkerror( int cond, char *e )
-{
-    if( !cond )
-        return;
-    fprintf( stderr, "error: %s\n", e ? e : "?" );
-    abort();
-}
-
-static void disp_init_display( void )
-{
-    Visual *visual;
-    int dpy_class;
-    int screen;
-    int dpy_depth;
-
-    if( disp_display )
-        return;
-    memset( &disp_window, 0, sizeof(disp_window) );
-    disp_display = XOpenDisplay( "" );
-    disp_chkerror( !disp_display, "no display" );
-    screen = DefaultScreen( disp_display );
-    visual = DefaultVisual( disp_display, screen );
-    dpy_class = visual->class;
-    dpy_depth = DefaultDepth( disp_display, screen );
-    disp_chkerror( !((dpy_class == TrueColor && dpy_depth == 32)
-        || (dpy_class == TrueColor && dpy_depth == 24)
-        || (dpy_class == TrueColor && dpy_depth == 16)
-        || (dpy_class == PseudoColor && dpy_depth == 8)),
-        "requires 8 bit PseudoColor or 16/24/32 bit TrueColor display" );
-}
-
-static void disp_init_window( int num, int width, int height, const unsigned char *title )
-{
-    XSetWindowAttributes xswa;
-    XEvent xev;
-    int screen = DefaultScreen(disp_display);
-    Visual *visual = DefaultVisual (disp_display, screen);
-    char buf[200];
-    Window window;
-
-    if( title )
-        snprintf( buf, 200, "%s: %i/disp", title, num );
-    else
-        snprintf( buf, 200, "%i/disp", num );
-
-    XSizeHints *shint = XAllocSizeHints();
-    disp_chkerror( !shint, "memerror" );
-    shint->min_width = shint->max_width = shint->width = width;
-    shint->min_height = shint->max_height = shint->height = height;
-    shint->flags = PSize | PMinSize | PMaxSize;
-    disp_chkerror( num < 0 || num >= 10, "bad win num" );
-    if( !disp_window[num].init )
-    {
-        unsigned int mask = 0;
-        disp_window[num].init = 1;
-        unsigned int bg = WhitePixel( disp_display, screen );
-        unsigned int fg = BlackPixel( disp_display, screen );
-        int dpy_depth = DefaultDepth( disp_display, screen );
-        if( dpy_depth==32 || dpy_depth==24 || dpy_depth==16 )
-        {
-            mask |= CWColormap;
-            xswa.colormap = XCreateColormap( disp_display, DefaultRootWindow( disp_display ), visual, AllocNone );
-        }
-        xswa.background_pixel = bg;
-        xswa.border_pixel = fg;
-        xswa.backing_store = Always;
-        xswa.backing_planes = -1;
-        xswa.bit_gravity = NorthWestGravity;
-        mask = CWBackPixel | CWBorderPixel | CWBackingStore | CWBackingPlanes | CWBitGravity;
-        window = XCreateWindow( disp_display, DefaultRootWindow( disp_display ),
-                                shint->x, shint->y, shint->width, shint->height,
-                                1, dpy_depth, InputOutput, visual, mask, &xswa );
-        disp_window[num].window = window;
-
-        XSelectInput( disp_display, window, event_mask );
-        XSetStandardProperties( disp_display, window, buf, buf, None, NULL, 0, shint );
-        XMapWindow( disp_display, window );
-
-        do {
-            XNextEvent( disp_display, &xev );
-        } while( xev.type != MapNotify || xev.xmap.event != window );
-    }
-    window = disp_window[num].window;
-    XSetStandardProperties( disp_display, window, buf, buf, None, NULL, 0, shint );
-    XResizeWindow( disp_display, window, width, height );
-    XSync( disp_display, 1 );
-    XFree( shint );
-}
-
-void disp_sync( void )
-{
-    XSync( disp_display, 1 );
-}
-
-void disp_setcolor( unsigned char *name )
-{
-    XColor c_exact, c_nearest;
-
-    int screen = DefaultScreen( disp_display );
-    GC gc = DefaultGC( disp_display, screen );
-    Colormap cm = DefaultColormap( disp_display, screen );
-    Status st = XAllocNamedColor( disp_display, cm, name, &c_nearest, &c_exact );
-    disp_chkerror( st != 1, "XAllocNamedColor error" );
-    XSetForeground( disp_display, gc, c_nearest.pixel );
-}
-
-void disp_gray( int num, char *data, int width, int height, int stride, const unsigned char *title )
-{
-    char dummy;
-
-    disp_init_display();
-    disp_init_window( num, width, height, title );
-    int screen = DefaultScreen( disp_display );
-    Visual *visual = DefaultVisual( disp_display, screen );
-    int dpy_depth = DefaultDepth( disp_display, screen );
-    XImage *ximage = XCreateImage( disp_display, visual, dpy_depth, ZPixmap, 0, &dummy, width, height, 8, 0 );
-    disp_chkerror( !ximage, "no ximage" );
-#if WORDS_BIGENDIAN
-    ximage->byte_order = MSBFirst;
-    ximage->bitmap_bit_order = MSBFirst;
-#else
-    ximage->byte_order = LSBFirst;
-    ximage->bitmap_bit_order = LSBFirst;
-#endif
-
-    int pixelsize = dpy_depth>8 ? sizeof(int) : sizeof(unsigned char);
-    uint8_t *image = malloc( width * height * pixelsize );
-    disp_chkerror( !image, "malloc failed" );
-    for( int y = 0; y < height; y++ )
-        for( int x = 0; x < width; x++ )
-            memset( &image[(width*y + x)*pixelsize], data[y*stride+x], pixelsize );
-    ximage->data = image;
-    GC gc = DefaultGC( disp_display, screen );
-
-    XPutImage( disp_display, disp_window[num].window, gc, ximage, 0, 0, 0, 0, width, height );
-    XPutImage( disp_display, disp_window[num].window, gc, ximage, 0, 0, 0, 0, width, height );
-
-    XDestroyImage( ximage );
-    XSync( disp_display, 1 );
-
-}
-
-void disp_gray_zoom(int num, char *data, int width, int height, int stride, const unsigned char *title, int zoom)
-{
-    unsigned char *dataz = malloc( width*zoom * height*zoom );
-    disp_chkerror( !dataz, "malloc" );
-    for( int y = 0; y < height; y++ )
-        for( int x = 0; x < width; x++ )
-            for( int y0 = 0; y0 < zoom; y0++ )
-                for( int x0 = 0; x0 < zoom; x0++ )
-                    dataz[(y*zoom + y0)*width*zoom + x*zoom + x0] = data[y*stride+x];
-    disp_gray( num, dataz, width*zoom, height*zoom, width*zoom, title );
-    free( dataz );
-}
-
-void disp_point( int num, int x1, int y1 )
-{
-    int screen = DefaultScreen( disp_display );
-    GC gc = DefaultGC( disp_display, screen );
-    XDrawPoint( disp_display, disp_window[num].window, gc, x1, y1 );
-}
-
-void disp_line( int num, int x1, int y1, int x2, int y2 )
-{
-    int screen = DefaultScreen( disp_display );
-    GC gc = DefaultGC( disp_display, screen );
-    XDrawLine( disp_display, disp_window[num].window, gc, x1, y1, x2, y2 );
-}
-
-void disp_rect( int num, int x1, int y1, int x2, int y2 )
-{
-    int screen = DefaultScreen( disp_display );
-    GC gc = DefaultGC( disp_display, screen );
-    XDrawRectangle( disp_display, disp_window[num].window, gc, x1, y1, x2-x1, y2-y1 );
-}
diff --git a/common/display.h b/common/display.h
deleted file mode 100644 (file)
index afae456..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*****************************************************************************
- * display.h: x11 visualization interface
- *****************************************************************************
- * Copyright (C) 2005-2013 x264 project
- *
- * Authors: Tuukka Toivonen <tuukkat@ee.oulu.fi>
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
- *
- * This program is also available under a commercial proprietary license.
- * For more information, contact us at licensing@x264.com.
- *****************************************************************************/
-
-#ifndef X264_DISPLAY_H
-#define X264_DISPLAY_H
-
-void disp_sync(void);
-void disp_setcolor(unsigned char *name);
-/* Display a region of byte wide memory as a grayscale image.
- * num is the window to use for displaying. */
-void disp_gray(int num, char *data, int width, int height,
-               int stride, const unsigned char *title);
-void disp_gray_zoom(int num, char *data, int width, int height,
-               int stride, const unsigned char *title, int zoom);
-void disp_point(int num, int x1, int y1);
-void disp_line(int num, int x1, int y1, int x2, int y2);
-void disp_rect(int num, int x1, int y1, int x2, int y2);
-
-#endif
diff --git a/common/visualize.c b/common/visualize.c
deleted file mode 100644 (file)
index 9e80afb..0000000
+++ /dev/null
@@ -1,341 +0,0 @@
-/*****************************************************************************
- * visualize.c: visualization
- *****************************************************************************
- * Copyright (C) 2005-2013 x264 project
- *
- * Authors: Tuukka Toivonen <tuukkat@ee.oulu.fi>
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
- *
- * This program is also available under a commercial proprietary license.
- * For more information, contact us at licensing@x264.com.
- *****************************************************************************/
-
-/*
- * Some explanation of the symbols used:
- * Red/pink: intra block
- * Blue: inter block
- * Green: skip block
- * Yellow: B-block (not visualized properly yet)
- *
- * Motion vectors have black dot at their target (ie. at the MB center),
- * instead of arrowhead. The black dot is enclosed in filled diamond with radius
- * depending on reference frame number (one frame back = zero width, normal case).
- *
- * The intra blocks have generally lines drawn perpendicular
- * to the prediction direction, so for example, if there is a pink block
- * with horizontal line at the top of it, it is interpolated by assuming
- * luma to be vertically constant.
- * DC predicted blocks have both horizontal and vertical lines,
- * pink blocks with a diagonal line are predicted using the planar function.
- */
-
-#include "common.h"
-#include "visualize.h"
-#include "display.h"
-
-typedef struct
-{
-    int     i_type;
-    int     i_partition;
-    int     i_sub_partition[4];
-    int     i_intra16x16_pred_mode;
-    int     intra4x4_pred_mode[4][4];
-    int8_t  ref[2][4][4];                  /* [list][y][x] */
-    int16_t mv[2][4][4][2];                /* [list][y][x][mvxy] */
-} visualize_t;
-
-/* Return string from stringlist corresponding to the given code */
-#define GET_STRING(sl, code) get_string((sl), sizeof(sl)/sizeof(*(sl)), code)
-
-typedef struct
-{
-    int code;
-    char *string;
-} stringlist_t;
-
-static char *get_string( const stringlist_t *sl, int entries, int code )
-{
-    for( int i = 0; i < entries; i++ )
-        if( sl[i].code == code )
-            return sl[i].string;
-    return "?";
-}
-
-/* Plot motion vector */
-static void mv( int x0, int y0, int16_t dmv[2], int ref, int zoom, char *col )
-{
-    int dx = dmv[0];
-    int dy = dmv[1];
-
-    dx = (dx * zoom + 2) >> 2;
-    dy = (dy * zoom + 2) >> 2;
-    disp_line( 0, x0, y0, x0+dx, y0+dy );
-    for( int i = 1; i < ref; i++ )
-    {
-        disp_line( 0, x0  , y0-i, x0+i, y0   );
-        disp_line( 0, x0+i, y0  , x0  , y0+i );
-        disp_line( 0, x0  , y0+i, x0-i, y0   );
-        disp_line( 0, x0-i, y0  , x0  , y0-i );
-    }
-    disp_setcolor( "black" );
-    disp_point( 0, x0, y0 );
-    disp_setcolor( col );
-}
-
-int x264_visualize_init( x264_t *h )
-{
-    CHECKED_MALLOC( h->visualize, h->mb.i_mb_width * h->mb.i_mb_height * sizeof(visualize_t) );
-    return 0;
-fail:
-    return -1;
-}
-
-void x264_visualize_mb( x264_t *h )
-{
-    visualize_t *v = (visualize_t*)h->visualize + h->mb.i_mb_xy;
-
-    /* Save all data for the MB that we need for drawing the visualization */
-    v->i_type = h->mb.i_type;
-    v->i_partition = h->mb.i_partition;
-    for( int i = 0; i < 4; i++ )
-        v->i_sub_partition[i] = h->mb.i_sub_partition[i];
-    for( int y = 0; y < 4; y++ )
-        for( int x = 0; x < 4; x++ )
-            v->intra4x4_pred_mode[y][x] = h->mb.cache.intra4x4_pred_mode[X264_SCAN8_0+y*8+x];
-    for( int l = 0; l < 2; l++ )
-        for( int y = 0; y < 4; y++ )
-            for( int x = 0; x < 4; x++ )
-            {
-                for( int i = 0; i < 2; i++ )
-                    v->mv[l][y][x][i] = h->mb.cache.mv[l][X264_SCAN8_0+y*8+x][i];
-                v->ref[l][y][x] = h->mb.cache.ref[l][X264_SCAN8_0+y*8+x];
-            }
-    v->i_intra16x16_pred_mode = h->mb.i_intra16x16_pred_mode;
-}
-
-void x264_visualize_close( x264_t *h )
-{
-    x264_free(h->visualize);
-}
-
-/* Display visualization (block types, MVs) of the encoded frame */
-/* FIXME: B-type MBs not handled yet properly */
-void x264_visualize_show( x264_t *h )
-{
-    static const stringlist_t mb_types[] =
-    {
-        /* Block types marked as NULL will not be drawn */
-        { I_4x4   , "red" },
-        { I_8x8   , "#ff5640" },
-        { I_16x16 , "#ff8060" },
-        { I_PCM   , "violet" },
-        { P_L0    , "SlateBlue" },
-        { P_8x8   , "blue" },
-        { P_SKIP  , "green" },
-        { B_DIRECT, "yellow" },
-        { B_L0_L0 , "yellow" },
-        { B_L0_L1 , "yellow" },
-        { B_L0_BI , "yellow" },
-        { B_L1_L0 , "yellow" },
-        { B_L1_L1 , "yellow" },
-        { B_L1_BI , "yellow" },
-        { B_BI_L0 , "yellow" },
-        { B_BI_L1 , "yellow" },
-        { B_BI_BI , "yellow" },
-        { B_8x8   , "yellow" },
-        { B_SKIP  , "yellow" },
-    };
-
-    static const int waitkey = 1;     /* Wait for enter after each frame */
-    static const int drawbox = 1;     /* Draw box around each block */
-    static const int borders = 0;     /* Display extrapolated borders outside frame */
-    static const int zoom = 2;        /* Zoom factor */
-
-    static const int pad = 32;
-    pixel *const frame = h->fdec->plane[0];
-    const int width = h->param.i_width;
-    const int height = h->param.i_height;
-    const int stride = h->fdec->i_stride[0];
-
-    if( borders )
-        disp_gray_zoom( 0, frame - pad*stride - pad, width+2*pad, height+2*pad, stride, "fdec", zoom );
-    else
-        disp_gray_zoom( 0, frame, width, height, stride, "fdec", zoom );
-
-    for( int mb_xy = 0; mb_xy < h->mb.i_mb_width * h->mb.i_mb_height; mb_xy++ )
-    {
-        visualize_t *const v = (visualize_t*)h->visualize + mb_xy;
-        const int mb_y = mb_xy / h->mb.i_mb_width;
-        const int mb_x = mb_xy % h->mb.i_mb_width;
-        char *const col = GET_STRING( mb_types, v->i_type );
-        int x = mb_x*16*zoom;
-        int y = mb_y*16*zoom;
-        int l = 0;
-
-        if( !col )
-            continue;
-
-        if( borders )
-        {
-            x += pad*zoom;
-            y += pad*zoom;
-        }
-
-        disp_setcolor( col );
-        if( drawbox ) disp_rect( 0, x, y, x+16*zoom-1, y+16*zoom-1 );
-
-        if( v->i_type==P_L0 || v->i_type==P_8x8 || v->i_type==P_SKIP )
-        {
-            /* Predicted (inter) mode, with motion vector */
-            if( v->i_partition == D_16x16 || v->i_type == P_SKIP )
-                mv( x+8*zoom, y+8*zoom, v->mv[l][0][0], v->ref[l][0][0], zoom, col );
-            else if (v->i_partition == D_16x8)
-            {
-                if( drawbox ) disp_rect( 0, x, y, x+16*zoom, y+8*zoom );
-                mv( x+8*zoom, y+4*zoom, v->mv[l][0][0], v->ref[l][0][0], zoom, col );
-                if( drawbox ) disp_rect( 0, x, y+8*zoom, x+16*zoom, y+16*zoom );
-                mv( x+8*zoom, y+12*zoom, v->mv[l][2][0], v->ref[l][2][0], zoom, col );
-            }
-            else if( v->i_partition==D_8x16 )
-            {
-                if( drawbox ) disp_rect( 0, x,          y, x+8*zoom,  y+16*zoom );
-                mv( x+4*zoom, y+8*zoom, v->mv[l][0][0], v->ref[l][0][0], zoom, col );
-                if( drawbox ) disp_rect( 0, x+8*zoom,   y, x+16*zoom, y+16*zoom );
-                mv( x+12*zoom, y+8*zoom, v->mv[l][0][2], v->ref[l][0][2], zoom, col );
-            }
-            else if( v->i_partition==D_8x8 )
-            {
-                for( int i = 0; i < 2; i++ )
-                    for( int j = 0; j < 2; j++ )
-                    {
-                        int sp = v->i_sub_partition[i*2+j];
-                        const int x0 = x + j*8*zoom;
-                        const int y0 = y + i*8*zoom;
-                        l = x264_mb_partition_listX_table[0][sp] ? 0 : 1; /* FIXME: not tested if this works */
-                        if( IS_SUB8x8(sp) )
-                        {
-                            if( drawbox ) disp_rect( 0, x0, y0, x0+8*zoom, y0+8*zoom );
-                            mv( x0+4*zoom, y0+4*zoom, v->mv[l][2*i][2*j], v->ref[l][2*i][2*j], zoom, col );
-                        }
-                        else if( IS_SUB8x4(sp) )
-                        {
-                            if( drawbox ) disp_rect( 0, x0, y0, x0+8*zoom, y0+4*zoom );
-                            if( drawbox ) disp_rect( 0, x0, y0+4*zoom, x0+8*zoom, y0+8*zoom );
-                            mv( x0+4*zoom, y0+2*zoom, v->mv[l][2*i][2*j], v->ref[l][2*i][2*j], zoom, col );
-                            mv( x0+4*zoom, y0+6*zoom, v->mv[l][2*i+1][2*j], v->ref[l][2*i+1][2*j], zoom, col );
-                        }
-                        else if( IS_SUB4x8(sp) )
-                        {
-                            if( drawbox ) disp_rect( 0, x0, y0, x0+4*zoom, y0+8*zoom );
-                            if( drawbox ) disp_rect( 0, x0+4*zoom, y0, x0+8*zoom, y0+8*zoom );
-                            mv( x0+2*zoom, y0+4*zoom, v->mv[l][2*i][2*j], v->ref[l][2*i][2*j], zoom, col );
-                            mv( x0+6*zoom, y0+4*zoom, v->mv[l][2*i][2*j+1], v->ref[l][2*i][2*j+1], zoom, col );
-                        }
-                        else if( IS_SUB4x4(sp) )
-                        {
-                            if( drawbox ) disp_rect( 0, x0, y0, x0+4*zoom, y0+4*zoom );
-                            if( drawbox ) disp_rect( 0, x0+4*zoom, y0, x0+8*zoom, y0+4*zoom );
-                            if( drawbox ) disp_rect( 0, x0, y0+4*zoom, x0+4*zoom, y0+8*zoom );
-                            if( drawbox ) disp_rect( 0, x0+4*zoom, y0+4*zoom, x0+8*zoom, y0+8*zoom );
-                            mv( x0+2*zoom, y0+2*zoom, v->mv[l][2*i][2*j], v->ref[l][2*i][2*j], zoom, col );
-                            mv( x0+6*zoom, y0+2*zoom, v->mv[l][2*i][2*j+1], v->ref[l][2*i][2*j+1], zoom, col );
-                            mv( x0+2*zoom, y0+6*zoom, v->mv[l][2*i+1][2*j], v->ref[l][2*i+1][2*j], zoom, col );
-                            mv( x0+6*zoom, y0+6*zoom, v->mv[l][2*i+1][2*j+1], v->ref[l][2*i+1][2*j+1], zoom, col );
-                        }
-                    }
-            }
-        }
-
-        if( IS_INTRA(v->i_type) || v->i_type == I_PCM )
-        {
-            /* Intra coded */
-            if( v->i_type == I_16x16 )
-            {
-                switch (v->i_intra16x16_pred_mode) {
-                case I_PRED_16x16_V:
-                    disp_line( 0, x+2*zoom, y+2*zoom, x+14*zoom, y+2*zoom );
-                    break;
-                case I_PRED_16x16_H:
-                    disp_line( 0, x+2*zoom, y+2*zoom, x+2*zoom, y+14*zoom );
-                    break;
-                case I_PRED_16x16_DC:
-                case I_PRED_16x16_DC_LEFT:
-                case I_PRED_16x16_DC_TOP:
-                case I_PRED_16x16_DC_128:
-                    disp_line( 0, x+2*zoom, y+2*zoom, x+14*zoom, y+2*zoom );
-                    disp_line( 0, x+2*zoom, y+2*zoom, x+2*zoom, y+14*zoom );
-                    break;
-                case I_PRED_16x16_P:
-                    disp_line( 0, x+2*zoom, y+2*zoom, x+8*zoom, y+8*zoom );
-                    break;
-                }
-            }
-            if( v->i_type==I_4x4 || v->i_type==I_8x8 )
-            {
-                const int di = v->i_type == I_8x8 ? 2 : 1;
-                const int zoom2 = zoom * di;
-                for( int i = 0; i < 4; i += di )
-                    for( int j = 0; j < 4; j += di )
-                    {
-                        const int x0 = x + j*4*zoom;
-                        const int y0 = y + i*4*zoom;
-                        if( drawbox ) disp_rect( 0, x0, y0, x0+4*zoom2, y0+4*zoom2 );
-                        switch( v->intra4x4_pred_mode[i][j] )
-                        {
-                            case I_PRED_4x4_V:        /* Vertical */
-                                disp_line( 0, x0+0*zoom2, y0+1*zoom2, x0+4*zoom2, y0+1*zoom2 );
-                                break;
-                            case I_PRED_4x4_H:        /* Horizontal */
-                                disp_line( 0, x0+1*zoom2, y0+0*zoom2, x0+1*zoom2, y0+4*zoom2 );
-                                break;
-                            case I_PRED_4x4_DC:        /* DC, average from top and left sides */
-                            case I_PRED_4x4_DC_LEFT:
-                            case I_PRED_4x4_DC_TOP:
-                            case I_PRED_4x4_DC_128:
-                                disp_line( 0, x0+1*zoom2, y0+1*zoom2, x0+4*zoom2, y0+1*zoom2 );
-                                disp_line( 0, x0+1*zoom2, y0+1*zoom2, x0+1*zoom2, y0+4*zoom2 );
-                                break;
-                            case I_PRED_4x4_DDL:    /* Topright-bottomleft */
-                                disp_line( 0, x0+0*zoom2, y0+0*zoom2, x0+4*zoom2, y0+4*zoom2 );
-                                break;
-                            case I_PRED_4x4_DDR:    /* Topleft-bottomright */
-                                disp_line( 0, x0+0*zoom2, y0+4*zoom2, x0+4*zoom2, y0+0*zoom2 );
-                                break;
-                            case I_PRED_4x4_VR:        /* Mix of topleft-bottomright and vertical */
-                                disp_line( 0, x0+0*zoom2, y0+2*zoom2, x0+4*zoom2, y0+1*zoom2 );
-                                break;
-                            case I_PRED_4x4_HD:        /* Mix of topleft-bottomright and horizontal */
-                                disp_line( 0, x0+2*zoom2, y0+0*zoom2, x0+1*zoom2, y0+4*zoom2 );
-                                break;
-                            case I_PRED_4x4_VL:        /* Mix of topright-bottomleft and vertical */
-                                disp_line( 0, x0+0*zoom2, y0+1*zoom2, x0+4*zoom2, y0+2*zoom2 );
-                                break;
-                            case I_PRED_4x4_HU:        /* Mix of topright-bottomleft and horizontal */
-                                disp_line( 0, x0+1*zoom2, y0+0*zoom2, x0+2*zoom2, y0+4*zoom2 );
-                                break;
-                        }
-                    }
-            }
-        }
-    }
-
-    disp_sync();
-    if( waitkey )
-        getchar();
-}
-/* }}} */
-
-//EOF
diff --git a/common/visualize.h b/common/visualize.h
deleted file mode 100644 (file)
index 8655adf..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*****************************************************************************
- * visualize.h: visualization
- *****************************************************************************
- * Copyright (C) 2005-2013 x264 project
- *
- * Authors: Tuukka Toivonen <tuukkat@ee.oulu.fi>
- *
- * This program 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.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
- *
- * This program is also available under a commercial proprietary license.
- * For more information, contact us at licensing@x264.com.
- *****************************************************************************/
-
-#ifndef X264_VISUALIZE_H
-#define X264_VISUALIZE_H
-
-#include "common/common.h"
-
-int  x264_visualize_init( x264_t *h );
-void x264_visualize_mb( x264_t *h );
-void x264_visualize_show( x264_t *h );
-void x264_visualize_close( x264_t *h );
-
-#endif
index f117512a82330920d87594bc39af9810b5d35d1e..0177cfceffe7df7c18e9e2962d64fcd3b5010e7f 100755 (executable)
--- a/configure
+++ b/configure
@@ -30,7 +30,6 @@ Configuration options:
   --disable-thread         disable multithreaded encoding
   --enable-win32thread     use win32threads (windows only)
   --disable-interlaced     disable interlaced encoding support
-  --enable-visualize       enable visualization (X11 only)
   --bit-depth=BIT_DEPTH    set output bit depth (8-10) [8]
   --chroma-format=FORMAT   output chroma format (420, 422, 444, all) [all]
 
@@ -276,7 +275,6 @@ debug="no"
 gprof="no"
 strip="no"
 pic="no"
-vis="no"
 bit_depth="8"
 chroma_format="all"
 compiler="GNU"
@@ -293,7 +291,7 @@ cross_prefix=""
 EXE=""
 
 # list of all preprocessor HAVE values we can define
-CONFIG_HAVE="MALLOC_H ALTIVEC ALTIVEC_H MMX ARMV6 ARMV6T2 NEON BEOSTHREAD POSIXTHREAD WIN32THREAD THREAD LOG2F VISUALIZE SWSCALE \
+CONFIG_HAVE="MALLOC_H ALTIVEC ALTIVEC_H MMX ARMV6 ARMV6T2 NEON BEOSTHREAD POSIXTHREAD WIN32THREAD THREAD LOG2F SWSCALE \
              LAVF FFMS GPAC AVS GPL VECTOREXT INTERLACED CPU_COUNT OPENCL THP LSMASH"
 
 # parse options
@@ -387,9 +385,6 @@ for opt do
         --enable-pic)
             pic="yes"
             ;;
-        --enable-visualize)
-            vis="yes"
-            ;;
         --host=*)
             host="$optarg"
             ;;
@@ -843,18 +838,6 @@ if [ "$SYS" = "LINUX" -a \( "$ARCH" = "X86" -o "$ARCH" = "X86_64" \) ] && cc_che
     define HAVE_THP
 fi
 
-if [ "$vis" = "yes" ] ; then
-    save_CFLAGS="$CFLAGS"
-    CFLAGS="$CFLAGS -I/usr/X11R6/include"
-    if cc_check "X11/Xlib.h" "-L/usr/X11R6/lib -lX11" "XOpenDisplay(0);" ; then
-        LDFLAGS="-L/usr/X11R6/lib -lX11 $LDFLAGS"
-        define HAVE_VISUALIZE
-    else
-        vis="no"
-        CFLAGS="$save_CFLAGS"
-   fi
-fi
-
 if [ "$swscale" = "auto" ] ; then
     swscale="no"
     if ${cross_prefix}pkg-config --exists libswscale 2>/dev/null; then
@@ -1297,7 +1280,6 @@ debug:         $debug
 gprof:         $gprof
 strip:         $strip
 PIC:           $pic
-visualize:     $vis
 bit depth:     $bit_depth
 chroma format: $chroma_format
 EOF
index e365caa88798a3e76a85b792fbef780cae698207..f8596e84f764a05a7514afc5a9b0dc60b556f839 100644 (file)
 #include "macroblock.h"
 #include "me.h"
 
-#if HAVE_VISUALIZE
-#include "common/visualize.h"
-#endif
-
 //#define DEBUG_MB_TYPE
 
 #define bs_write_ue bs_write_ue_big
@@ -1225,7 +1221,6 @@ static int x264_validate_parameters( x264_t *h, int b_open )
     BOOLIFY( b_sliced_threads );
     BOOLIFY( b_interlaced );
     BOOLIFY( b_intra_refresh );
-    BOOLIFY( b_visualize );
     BOOLIFY( b_aud );
     BOOLIFY( b_repeat_headers );
     BOOLIFY( b_annexb );
@@ -2757,11 +2752,6 @@ reencode:
 cont:
         h->mb.b_reencode_mb = 0;
 
-#if HAVE_VISUALIZE
-        if( h->param.b_visualize )
-            x264_visualize_mb( h );
-#endif
-
         /* save cache */
         x264_macroblock_cache_save( h );
 
@@ -2956,12 +2946,6 @@ static void *x264_slices_write( x264_t *h )
     int i_slice_num = 0;
     int last_thread_mb = h->sh.i_last_mb;
 
-#if HAVE_VISUALIZE
-    if( h->param.b_visualize )
-        if( x264_visualize_init( h ) )
-            goto fail;
-#endif
-
     /* init stats */
     memset( &h->stat.frame, 0, sizeof(h->stat.frame) );
     h->mb.b_reencode_mb = 0;
@@ -3007,14 +2991,6 @@ static void *x264_slices_write( x264_t *h )
             h->sh.i_first_mb -= h->mb.i_mb_stride;
     }
 
-#if HAVE_VISUALIZE
-    if( h->param.b_visualize )
-    {
-        x264_visualize_show( h );
-        x264_visualize_close( h );
-    }
-#endif
-
     return (void *)0;
 
 fail:
diff --git a/x264.c b/x264.c
index 472fc437e935828a9696164d96ad41a53c9b1878..d782ae05dd9805c7c3dba39434aec21e1b8c1496 100644 (file)
--- a/x264.c
+++ b/x264.c
@@ -142,16 +142,8 @@ static int get_argv_utf8( int *argc_ptr, char ***argv_ptr )
 
 /* Ctrl-C handler */
 static volatile int b_ctrl_c = 0;
-static int          b_exit_on_ctrl_c = 0;
 static void sigint_handler( int a )
 {
-    if( b_exit_on_ctrl_c )
-    {
-#ifdef _WIN32
-        SetConsoleTitleW( org_console_title );
-#endif
-        exit( 0 );
-    }
     b_ctrl_c = 1;
 }
 
@@ -910,7 +902,6 @@ static void help( x264_param_t *defaults, int longhelp )
     H2( "      --opencl                Enable use of OpenCL\n" );
     H2( "      --opencl-clbin <string> Specify path of compiled OpenCL kernel cache\n" );
     H2( "      --opencl-device <integer> Specify OpenCL device ordinal\n" );
-    H2( "      --visualize             Show MB types overlayed on the encoded video\n" );
     H2( "      --dump-yuv <string>     Save reconstructed frames\n" );
     H2( "      --sps-id <integer>      Set SPS and PPS id numbers [%d]\n", defaults->i_sps_id );
     H2( "      --aud                   Use access unit delimiters\n" );
@@ -942,7 +933,6 @@ typedef enum
     OPT_THREAD_INPUT,
     OPT_QUIET,
     OPT_NOPROGRESS,
-    OPT_VISUALIZE,
     OPT_LONGHELP,
     OPT_PROFILE,
     OPT_PRESET,
@@ -1092,7 +1082,6 @@ static struct option long_options[] =
     { "verbose",           no_argument, NULL, 'v' },
     { "log-level",   required_argument, NULL, OPT_LOG_LEVEL },
     { "no-progress",       no_argument, NULL, OPT_NOPROGRESS },
-    { "visualize",         no_argument, NULL, OPT_VISUALIZE },
     { "dump-yuv",    required_argument, NULL, 0 },
     { "sps-id",      required_argument, NULL, 0 },
     { "aud",               no_argument, NULL, 0 },
@@ -1462,14 +1451,6 @@ static int parse( int argc, char **argv, x264_param_t *param, cli_opt_t *opt )
             case OPT_NOPROGRESS:
                 opt->b_progress = 0;
                 break;
-            case OPT_VISUALIZE:
-#if HAVE_VISUALIZE
-                param->b_visualize = 1;
-                b_exit_on_ctrl_c = 1;
-#else
-                x264_cli_log( "x264", X264_LOG_WARNING, "not compiled with visualization support\n" );
-#endif
-                break;
             case OPT_TUNE:
             case OPT_PRESET:
                 break;
diff --git a/x264.h b/x264.h
index 8b8f2649b09bfc54b47d570ee3b12a1dcff026fc..8175c35d82bd18f292dfb162eccd9637183b14b4 100644 (file)
--- a/x264.h
+++ b/x264.h
@@ -41,7 +41,7 @@
 
 #include "x264_config.h"
 
-#define X264_BUILD 139
+#define X264_BUILD 140
 
 /* Application developers planning to link against a shared library version of
  * libx264 from a Microsoft Visual Studio or similar development environment
@@ -348,7 +348,6 @@ typedef struct x264_param_t
     void        (*pf_log)( void *, int i_level, const char *psz, va_list );
     void        *p_log_private;
     int         i_log_level;
-    int         b_visualize;
     int         b_full_recon;   /* fully reconstruct frames, even when not necessary for encoding.  Implied by psz_dump_yuv */
     char        *psz_dump_yuv;  /* filename (in UTF-8) for reconstructed frames */