亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? muxers.c

?? 絕對好的源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/***************************************************************************** * muxers.c: h264 file i/o plugins ***************************************************************************** * Copyright (C) 2003-2006 x264 project * * 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., 59 Temple Place - Suite 330, Boston, MA  02111, USA. *****************************************************************************/#define _LARGEFILE_SOURCE#define _FILE_OFFSET_BITS 64#include <stdio.h>#include <string.h>#include <sys/types.h>#include "common/common.h"#include "x264.h"#include "matroska.h"#include "muxers.h"#ifndef _MSC_VER#include "config.h"#endif#ifdef AVIS_INPUT#include <windows.h>#include <vfw.h>#endif#ifdef MP4_OUTPUT#include <gpac/isomedia.h>#endiftypedef struct {    FILE *fh;    int width, height;    int next_frame;} yuv_input_t;/* raw 420 yuv file operation */int open_file_yuv( char *psz_filename, hnd_t *p_handle, x264_param_t *p_param ){    yuv_input_t *h = malloc(sizeof(yuv_input_t));    h->width = p_param->i_width;    h->height = p_param->i_height;    h->next_frame = 0;    if( !strcmp(psz_filename, "-") )        h->fh = stdin;    else        h->fh = fopen(psz_filename, "rb");    if( h->fh == NULL )        return -1;    *p_handle = (hnd_t)h;    return 0;}int get_frame_total_yuv( hnd_t handle ){    yuv_input_t *h = handle;    int i_frame_total = 0;    if( !fseek( h->fh, 0, SEEK_END ) )    {        uint64_t i_size = ftell( h->fh );        fseek( h->fh, 0, SEEK_SET );        i_frame_total = (int)(i_size / ( h->width * h->height * 3 / 2 ));    }    return i_frame_total;}int read_frame_yuv( x264_picture_t *p_pic, hnd_t handle, int i_frame ){    yuv_input_t *h = handle;    if( i_frame != h->next_frame )        if( fseek( h->fh, (uint64_t)i_frame * h->width * h->height * 3 / 2, SEEK_SET ) )            return -1;    if( fread( p_pic->img.plane[0], 1, h->width * h->height, h->fh ) <= 0            || fread( p_pic->img.plane[1], 1, h->width * h->height / 4, h->fh ) <= 0            || fread( p_pic->img.plane[2], 1, h->width * h->height / 4, h->fh ) <= 0 )        return -1;    h->next_frame = i_frame+1;    return 0;}int close_file_yuv(hnd_t handle){    yuv_input_t *h = handle;    if( !h || !h->fh )        return 0;    return fclose(h->fh);}/* YUV4MPEG2 raw 420 yuv file operation */typedef struct {    FILE *fh;    int width, height;    int next_frame;    int seq_header_len, frame_header_len;    int frame_size;} y4m_input_t;#define Y4M_MAGIC "YUV4MPEG2"#define MAX_YUV4_HEADER 80#define Y4M_FRAME_MAGIC "FRAME"#define MAX_FRAME_HEADER 80int open_file_y4m( char *psz_filename, hnd_t *p_handle, x264_param_t *p_param ){    int  i, n, d;    int  interlaced;    char header[MAX_YUV4_HEADER+10];    char *tokstart, *tokend, *header_end;    y4m_input_t *h = malloc(sizeof(y4m_input_t));    h->next_frame = 0;    if( !strcmp(psz_filename, "-") )        h->fh = stdin;    else        h->fh = fopen(psz_filename, "rb");    if( h->fh == NULL )        return -1;    h->frame_header_len = strlen(Y4M_FRAME_MAGIC)+1;    /* Read header */    for( i=0; i<MAX_YUV4_HEADER; i++ )    {        header[i] = fgetc(h->fh);        if( header[i] == '\n' )        {            /* Add a space after last option. Makes parsing "444" vs               "444alpha" easier. */            header[i+1] = 0x20;            header[i+2] = 0;            break;        }    }    if( i == MAX_YUV4_HEADER || strncmp(header, Y4M_MAGIC, strlen(Y4M_MAGIC)) )        return -1;    /* Scan properties */    header_end = &header[i+1]; /* Include space */    h->seq_header_len = i+1;    for( tokstart = &header[strlen(Y4M_MAGIC)+1]; tokstart < header_end; tokstart++ )    {        if(*tokstart==0x20) continue;        switch(*tokstart++)        {        case 'W': /* Width. Required. */            h->width = p_param->i_width = strtol(tokstart, &tokend, 10);            tokstart=tokend;            break;        case 'H': /* Height. Required. */            h->height = p_param->i_height = strtol(tokstart, &tokend, 10);            tokstart=tokend;            break;        case 'C': /* Color space */            if( strncmp("420", tokstart, 3) )            {                fprintf(stderr, "Colorspace unhandled\n");                return -1;            }            tokstart = strchr(tokstart, 0x20);            break;        case 'I': /* Interlace type */            switch(*tokstart++)            {            case 'p': interlaced = 0; break;            case '?':            case 't':            case 'b':            case 'm':            default: interlaced = 1;                fprintf(stderr, "Warning, this sequence might be interlaced\n");            }            break;        case 'F': /* Frame rate - 0:0 if unknown */            if( sscanf(tokstart, "%d:%d", &n, &d) == 2 && n && d )            {                x264_reduce_fraction( &n, &d );                p_param->i_fps_num = n;                p_param->i_fps_den = d;            }            tokstart = strchr(tokstart, 0x20);            break;        case 'A': /* Pixel aspect - 0:0 if unknown */            if( sscanf(tokstart, "%d:%d", &n, &d) == 2 && n && d )            {                x264_reduce_fraction( &n, &d );                p_param->vui.i_sar_width = n;                p_param->vui.i_sar_height = d;            }            tokstart = strchr(tokstart, 0x20);            break;        case 'X': /* Vendor extensions */            if( !strncmp("YSCSS=",tokstart,6) )            {                /* Older nonstandard pixel format representation */                tokstart += 6;                if( strncmp("420JPEG",tokstart,7) &&                    strncmp("420MPEG2",tokstart,8) &&                    strncmp("420PALDV",tokstart,8) )                {                    fprintf(stderr, "Unsupported extended colorspace\n");                    return -1;                }            }            tokstart = strchr(tokstart, 0x20);            break;        }    }    fprintf(stderr, "yuv4mpeg: %ix%i@%i/%ifps, %i:%i\n",            h->width, h->height, p_param->i_fps_num, p_param->i_fps_den,            p_param->vui.i_sar_width, p_param->vui.i_sar_height);    *p_handle = (hnd_t)h;    return 0;}/* Most common case: frame_header = "FRAME" */int get_frame_total_y4m( hnd_t handle ){    y4m_input_t *h             = handle;    int          i_frame_total = 0;    off_t        init_pos      = ftell(h->fh);    if( !fseek( h->fh, 0, SEEK_END ) )    {        uint64_t i_size = ftell( h->fh );        fseek( h->fh, init_pos, SEEK_SET );        i_frame_total = (int)((i_size - h->seq_header_len) /                              (3*(h->width*h->height)/2+h->frame_header_len));    }    return i_frame_total;}int read_frame_y4m( x264_picture_t *p_pic, hnd_t handle, int i_frame ){    int          slen = strlen(Y4M_FRAME_MAGIC);    int          i    = 0;    char         header[16];    y4m_input_t *h    = handle;    if( i_frame != h->next_frame )    {        if (fseek(h->fh, (uint64_t)i_frame*(3*(h->width*h->height)/2+h->frame_header_len)                  + h->seq_header_len, SEEK_SET))            return -1;    }    /* Read frame header - without terminating '\n' */    if (fread(header, 1, slen, h->fh) != slen)        return -1;        header[slen] = 0;    if (strncmp(header, Y4M_FRAME_MAGIC, slen))    {        fprintf(stderr, "Bad header magic (%08X <=> %s)\n",                *((uint32_t*)header), header);        return -1;    }      /* Skip most of it */    while (i<MAX_FRAME_HEADER && fgetc(h->fh) != '\n')        i++;    if (i == MAX_FRAME_HEADER)    {        fprintf(stderr, "Bad frame header!\n");        return -1;    }    h->frame_header_len = i+slen+1;    if( fread(p_pic->img.plane[0], 1, h->width*h->height, h->fh) <= 0        || fread(p_pic->img.plane[1], 1, h->width * h->height / 4, h->fh) <= 0        || fread(p_pic->img.plane[2], 1, h->width * h->height / 4, h->fh) <= 0)        return -1;    h->next_frame = i_frame+1;    return 0;}int close_file_y4m(hnd_t handle){    y4m_input_t *h = handle;    if( !h || !h->fh )        return 0;    return fclose(h->fh);}/* avs/avi input file support under cygwin */#ifdef AVIS_INPUTtypedef struct {    PAVISTREAM p_avi;    int width, height;} avis_input_t;int gcd(int a, int b){    int c;    while (1)    {        c = a % b;        if (!c)            return b;        a = b;        b = c;    }}int open_file_avis( char *psz_filename, hnd_t *p_handle, x264_param_t *p_param ){    avis_input_t *h = malloc(sizeof(avis_input_t));    AVISTREAMINFO info;    int i;    *p_handle = (hnd_t)h;    AVIFileInit();    if( AVIStreamOpenFromFile( &h->p_avi, psz_filename, streamtypeVIDEO, 0, OF_READ, NULL ) )    {        AVIFileExit();        return -1;    }    if( AVIStreamInfo(h->p_avi, &info, sizeof(AVISTREAMINFO)) )    {        AVIStreamRelease(h->p_avi);        AVIFileExit();        return -1;    }    // check input format    if (info.fccHandler != MAKEFOURCC('Y', 'V', '1', '2'))    {        fprintf( stderr, "avis [error]: unsupported input format (%c%c%c%c)\n",            (char)(info.fccHandler & 0xff), (char)((info.fccHandler >> 8) & 0xff),            (char)((info.fccHandler >> 16) & 0xff), (char)((info.fccHandler >> 24)) );        AVIStreamRelease(h->p_avi);        AVIFileExit();        return -1;    }    h->width =    p_param->i_width = info.rcFrame.right - info.rcFrame.left;    h->height =    p_param->i_height = info.rcFrame.bottom - info.rcFrame.top;    i = gcd(info.dwRate, info.dwScale);    p_param->i_fps_den = info.dwScale / i;    p_param->i_fps_num = info.dwRate / i;    fprintf( stderr, "avis [info]: %dx%d @ %.2f fps (%d frames)\n",        p_param->i_width, p_param->i_height,        (double)p_param->i_fps_num / (double)p_param->i_fps_den,        (int)info.dwLength );    return 0;}int get_frame_total_avis( hnd_t handle ){    avis_input_t *h = handle;    AVISTREAMINFO info;    if( AVIStreamInfo(h->p_avi, &info, sizeof(AVISTREAMINFO)) )        return -1;    return info.dwLength;}int read_frame_avis( x264_picture_t *p_pic, hnd_t handle, int i_frame ){    avis_input_t *h = handle;    p_pic->img.i_csp = X264_CSP_YV12;    if( AVIStreamRead(h->p_avi, i_frame, 1, p_pic->img.plane[0], h->width * h->height * 3 / 2, NULL, NULL ) )        return -1;    return 0;}int close_file_avis( hnd_t handle ){    avis_input_t *h = handle;    AVIStreamRelease(h->p_avi);    AVIFileExit();    free(h);    return 0;}#endif#ifdef HAVE_PTHREADtypedef struct {    int (*p_read_frame)( x264_picture_t *p_pic, hnd_t handle, int i_frame );    int (*p_close_infile)( hnd_t handle );    hnd_t p_handle;    x264_picture_t pic;    pthread_t tid;    int next_frame;    int frame_total;    struct thread_input_arg_t *next_args;} thread_input_t;typedef struct thread_input_arg_t {    thread_input_t *h;    x264_picture_t *pic;    int i_frame;    int status;} thread_input_arg_t;int open_file_thread( char *psz_filename, hnd_t *p_handle, x264_param_t *p_param ){    thread_input_t *h = malloc(sizeof(thread_input_t));    x264_picture_alloc( &h->pic, X264_CSP_I420, p_param->i_width, p_param->i_height );    h->p_read_frame = p_read_frame;    h->p_close_infile = p_close_infile;    h->p_handle = *p_handle;    h->next_frame = -1;    h->next_args = malloc(sizeof(thread_input_arg_t));    h->next_args->h = h;    h->next_args->status = 0;    h->frame_total = p_get_frame_total( h->p_handle );    *p_handle = (hnd_t)h;    return 0;}int get_frame_total_thread( hnd_t handle ){    thread_input_t *h = handle;    return h->frame_total;}void read_frame_thread_int( thread_input_arg_t *i ){    i->status = i->h->p_read_frame( i->pic, i->h->p_handle, i->i_frame );}int read_frame_thread( x264_picture_t *p_pic, hnd_t handle, int i_frame ){    thread_input_t *h = handle;    UNUSED void *stuff;    int ret = 0;    if( h->next_frame >= 0 )    {        pthread_join( h->tid, &stuff );        ret |= h->next_args->status;    }    if( h->next_frame == i_frame )    {        XCHG( x264_picture_t, *p_pic, h->pic );    }    else    {        ret |= h->p_read_frame( p_pic, h->p_handle, i_frame );    }    if( !h->frame_total || i_frame+1 < h->frame_total )    {        h->next_frame =        h->next_args->i_frame = i_frame+1;        h->next_args->pic = &h->pic;        pthread_create( &h->tid, NULL, (void*)read_frame_thread_int, h->next_args );    }    else        h->next_frame = -1;    return ret;}int close_file_thread( hnd_t handle ){    thread_input_t *h = handle;    h->p_close_infile( h->p_handle );    x264_picture_clean( &h->pic );    free( h );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美一级在线播放| 国产视频不卡一区| 亚洲三级理论片| 成人av网站在线| 国产亚洲一区字幕| 成人一区在线观看| 欧美精彩视频一区二区三区| 九色综合狠狠综合久久| 欧美一卡2卡3卡4卡| 另类中文字幕网| 久久综合九色综合欧美98| 国产精品白丝av| 国产精品久久久久天堂| 色婷婷国产精品久久包臀| 亚洲午夜电影在线观看| 91精品国产综合久久精品性色| 日本vs亚洲vs韩国一区三区二区 | 99久免费精品视频在线观看 | 欧美一级理论性理论a| 久久国产剧场电影| 国产女主播视频一区二区| 99久久综合狠狠综合久久| 爽好久久久欧美精品| 精品成人一区二区三区四区| 国产ts人妖一区二区| 亚洲主播在线播放| 国产日韩欧美高清| 国产一区二区福利视频| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 91婷婷韩国欧美一区二区| 亚洲va欧美va人人爽| 欧美极品xxx| 亚洲精品一区二区三区蜜桃下载| 成人一区二区三区| 欧美日韩一区久久| 国产一区二区精品在线观看| 一区二区三区国产精华| 久久久777精品电影网影网| 一本色道**综合亚洲精品蜜桃冫| 卡一卡二国产精品| 1区2区3区欧美| 26uuu精品一区二区在线观看| 91成人在线免费观看| 狠狠色狠狠色综合系列| 亚洲一区二区三区在线看| 国产无一区二区| 777欧美精品| 7777精品伊人久久久大香线蕉经典版下载 | 一区二区三区成人在线视频| 91免费国产在线观看| 亚洲成人免费电影| 久久日韩粉嫩一区二区三区| 欧美视频在线一区| 日韩激情av在线| 中文字幕不卡在线| 日韩欧美专区在线| 欧美在线你懂的| 成人污污视频在线观看| 蜜桃传媒麻豆第一区在线观看| 91精品国产综合久久久蜜臀粉嫩| 高清不卡在线观看| 免费在线观看一区| 亚洲成人免费电影| 亚洲国产精品嫩草影院| 欧美白人最猛性xxxxx69交| 色综合久久中文字幕综合网| 男男视频亚洲欧美| 亚洲图片欧美一区| 亚洲三级在线免费| 国产视频一区不卡| 久久精品一区二区三区四区| 久久一留热品黄| 精品久久一区二区三区| 国产亚洲一区二区三区四区| 日韩一级二级三级精品视频| 欧美一区日韩一区| 国产欧美一区视频| 成人欧美一区二区三区| 综合在线观看色| 自拍av一区二区三区| 免费精品视频在线| 成人h精品动漫一区二区三区| 色94色欧美sute亚洲线路一久 | 一区二区三区精品在线| 久久亚洲综合色一区二区三区| 波多野结衣精品在线| 欧美日韩不卡在线| 26uuu精品一区二区在线观看| 亚洲女性喷水在线观看一区| 亚洲日本va在线观看| 蜜桃视频免费观看一区| 波波电影院一区二区三区| 在线观看日产精品| 精品国产不卡一区二区三区| 亚洲精品中文在线| 国产传媒久久文化传媒| 7777女厕盗摄久久久| 亚洲品质自拍视频| 韩日欧美一区二区三区| 5566中文字幕一区二区电影| 欧美激情在线一区二区| 激情综合色综合久久| 欧美日本国产一区| 18欧美乱大交hd1984| 国产999精品久久久久久绿帽| 日韩一区二区在线看片| 亚洲视频免费看| 91在线观看视频| 欧美成人性福生活免费看| 国产日韩欧美麻豆| 国产91精品精华液一区二区三区| 久久精品无码一区二区三区| 蜜桃av一区二区三区| 欧美一区二区福利视频| 久久精品理论片| www久久精品| 狠狠色丁香婷婷综合| 在线精品视频免费观看| 一区二区三区精品视频| 欧美精品免费视频| 亚洲va韩国va欧美va| 色婷婷久久99综合精品jk白丝| 国产欧美一区二区精品婷婷| 成人做爰69片免费看网站| 国产精品短视频| 欧美日韩大陆一区二区| 蜜桃精品视频在线观看| 亚洲国产精品精华液ab| 欧美亚洲日本国产| 久久99精品国产麻豆婷婷洗澡| 国产日产欧美一区| 欧美日韩亚洲综合一区| 韩国理伦片一区二区三区在线播放| 制服丝袜亚洲色图| 国产精品夜夜爽| 美女视频黄频大全不卡视频在线播放| 久久午夜国产精品| 欧美色图在线观看| 韩国女主播成人在线| 亚洲va欧美va人人爽午夜| 欧美高清精品3d| 色视频欧美一区二区三区| 日韩成人精品视频| 亚洲免费伊人电影| 欧美成人bangbros| 欧美精品一二三区| 91久久精品网| 激情综合色播激情啊| 日本亚洲最大的色成网站www| 国产精品久久久久婷婷| 精品久久久久一区二区国产| 欧美日韩国产一区| 色婷婷av一区二区三区软件| 国产一区二区免费在线| 国产精品99久久久久| 国产一区二区三区蝌蚪| 国产剧情在线观看一区二区| 精品一区二区免费视频| 亚洲免费观看高清完整版在线观看| 精品久久久久香蕉网| 88在线观看91蜜桃国自产| 欧美一区二区三区啪啪| 精品人伦一区二区色婷婷| 精品久久久久久久久久久久包黑料| 欧美夫妻性生活| 欧美日本一区二区在线观看| 欧美视频中文字幕| 欧美丝袜丝交足nylons图片| 99re成人精品视频| 欧美亚洲综合另类| 日韩美女主播在线视频一区二区三区| 欧美一区二区免费视频| www久久久久| 国产精品高潮呻吟久久| 亚洲成人激情自拍| 韩日欧美一区二区三区| 波多野结衣的一区二区三区| 欧美亚洲国产bt| 久久综合视频网| 国产日韩欧美高清| 午夜成人免费视频| 老司机免费视频一区二区| 成人小视频免费观看| 不卡的av网站| 在线观看亚洲精品视频| fc2成人免费人成在线观看播放| 欧美视频一区在线| 国产精品久久久久久久浪潮网站| 天天操天天色综合| 激情欧美日韩一区二区| 欧美三级视频在线播放| 久久看人人爽人人| 中文一区一区三区高中清不卡| 欧美videos大乳护士334| 国产精品电影一区二区| 精品午夜久久福利影院| 欧美日本韩国一区二区三区视频| 欧美激情一区不卡| 久久电影网站中文字幕| 欧美日韩国产高清一区|