naming.py

来自「JMVM MPEG MVC/3DAV 测试平台 国际通用标准」· Python 代码 · 共 40 行

PY
40
字号

"""
This module contains utilities for automatically creating names for things.
"""

import os, os.path, sys

def AlreadyEncodedView(config, viewNumber):
    """
    AlreadyEncodedView(config, viewNumber):

    config:  The config module containing the configuration information
             for this run.

    viewNumber:  View number (not the sequence number) of the view that
                 you want to check.

    This function returns true if the given viewNumber has already
    been successfully encoded.
    """
    return config.paramsForMVC['alreadyEncodedViews'].has_key(viewNumber)


def MakeInputFileNameForView(config, viewNumber):
    return os.path.join(config.paramsForMVC['SOURCEPATH'],
                        config.paramsForMVC['SEQUENCE'] + `viewNumber` +
                        config.paramsForMVC['suffix'])

def MakeOutputFileNameForView(config, view):
    return os.path.join(config.workingDir,'output_%i.264' % view)

def MakeReconFileNameForView(config, view):
    if ( AlreadyEncodedView(config, view) ):
        return config.paramsForMVC['alreadyEncodedViews'][view]
    else:
        return os.path.join(config.workingDir,'recon_%i.yuv' % view)

def MakeDecodedFileNameForView(config, view):
    return os.path.join(config.workingDir,'decoded_%i.yuv' % view)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?