示例#1
0
def main():

    parser = MCTF_parser(description="Info.")
    parser.add_argument("--GOPs",          help="number of GOPs to process. (Default = {})".format(info.GOPs))
    parser.add_argument("--TRLs",          help="number of iterations of the temporal transform + 1. (Default = {})".format(info.TRLs))
    parser.add_argument("--FPS",           help="frames per second. (Default = {})".format(info.FPS))

    args = parser.parse_known_args()[0]
    if args.GOPs:
        info.GOPs = int(args.GOPs)
    if args.TRLs:
        info.TRLs = int(args.TRLs)
    if args.FPS:
        info.FPS = int(args.FPS)


    x=info_j2k(info.GOPs, info.TRLs, info.FPS) #x=info_j2k() # ?
示例#2
0
def main():

    parser = MCTF_parser(description="Info.")
    parser.add_argument(
        "--GOPs",
        help="number of GOPs to process. (Default = {})".format(info.GOPs))
    parser.add_argument(
        "--TRLs",
        help="number of iterations of the temporal transform + 1. (Default = {})"
        .format(info.TRLs))
    parser.add_argument("--FPS",
                        help="frames per second. (Default = {})".format(
                            info.FPS))

    args = parser.parse_known_args()[0]
    if args.GOPs:
        info.GOPs = int(args.GOPs)
    if args.TRLs:
        info.TRLs = int(args.TRLs)
    if args.FPS:
        info.FPS = int(args.FPS)

    x = info_j2k(info.GOPs, info.TRLs, info.FPS)  #x=info_j2k() # ?
示例#3
0
pictures = 9
## Search range for motion vectors.
search_range = 4
## Sub-pixel accuracy in motion estimate.
subpixel_accuracy = 0
## Level update. For example, a value equal to 1/4 means that the high-frequency subband is 4 times less important than the low-frequency subband.
update_factor = 0  # 1.0/4

## The parser module provides an interface to Python's internal parser and byte-code compiler.
parser = MCTF_parser(description="Performs a temporal analysis step.")
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.GOPs(GOPs)
parser.TRLs(TRLs)
parser.add_argument(
    "--temporal_subband",
    help="iteration of the temporal transform.".format(temporal_subband))
parser.always_B(always_B)
parser.block_overlaping(block_overlaping)
parser.block_size(block_size)
parser.border_size(border_size)
parser.pictures(pictures)
parser.search_range(search_range)
parser.subpixel_accuracy(subpixel_accuracy)
parser.update_factor(update_factor)

## A script may only parse a few of the command-line arguments, passing the remaining arguments on to another script or program.
args = parser.parse_known_args()[0]
if args.pixels_in_x:
    pixels_in_x = int(args.pixels_in_x)
if args.pixels_in_y:
COMPONENTS = 3
BYTES_PER_COMPONENT = 1

file = ""
pictures = 33
pixels_in_x = 352
pixels_in_y = 288
quantization = 45000
subband = 4 # meterla en parametros !!!!!!!!!!!!!!!!!
SRLs = 5
nLayers = 5

parser = MCTF_parser(description="Compress the LFB texture data using JPEG 2000.")

parser.add_argument("--file", 
                    help="file that contains the LFB data. Default = {})".format(file))
parser.add_argument("--nLayers",
                    help="Number of layers. Logarithm controls the quality level and the bit-rate of the code-stream. (Default = {})".format(nLayers))
parser.pictures(pictures)
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.quantization(quantization)
parser.SRLs(SRLs)

args = parser.parse_known_args()[0]
if args.file:
    file = args.file
if args.nLayers:
    nLayers = args.nLayers
if args.pictures:
    pictures = int(args.pictures)
from MCTF_parser import MCTF_parser

COMPONENTS = 4
BITS_COMPONENT = 16
BYTES_COMPONENT = 2

blocks_in_x = 0
blocks_in_y = 0
fields = 0
file = ""
discard_levels = 0

parser = MCTF_parser(description="Expands the motion data using JPEG 2000.")
#parser.add_argument("--discard_levels",
#                    help="number of discard level. (Default = {})".format(discard_levels))
parser.add_argument("--blocks_in_x",
                    help="number of blocks in the X direction. (Default = {})".format(blocks_in_x))
parser.add_argument("--blocks_in_y",
                    help="number of blocks in the Y direction. (Default = {})".format(blocks_in_y))
parser.add_argument("--fields",
                    help="number of fields in to compress. (Default = {})".format(fields))
parser.add_argument("--file",
                    help="name of the file with the motion fields. (Default = {})".format(file))

args = parser.parse_known_args()[0]
#if args.discard_levels:
#    discard_levels = int(args.discard_levels)
if args.blocks_in_x:
    blocks_in_x = int(args.blocks_in_x)
if args.blocks_in_y:
    blocks_in_y = int(args.blocks_in_y)
if args.fields:
示例#6
0
from MCTF_parser import MCTF_parser

HIGH = "high_"
LOW = "low_"

discard_TRLs = 0
discard_SRLs_Tex = 0
discard_SRLs_Mot = 0
new_slope = 45000
GOPs = 1
TRLs = 6
List_Clayers = "11111"

parser = MCTF_parser(description="Transcode.")
parser.add_argument(
    "--discard_TRLs",
    help="number of discarded temporal resolution levels. (Default = {})".
    format(discard_TRLs))
parser.add_argument(
    "--discard_SRLs_Tex",
    help=
    "number of discarded spatial resolution levels for textures. (Default = {})"
    .format(discard_SRLs_Tex))
parser.add_argument(
    "--discard_SRLs_Mot",
    help=
    "number of discarded spatial resolution levels for motions. (Default = {})"
    .format(discard_SRLs_Mot))
parser.add_argument("--new_slope",
                    help="new slope. (Default = {})".format(new_slope))
parser.add_argument(
    "--GOPs", help="number of GOPs to process. (Default = {})".format(GOPs))
示例#7
0
import sys
import math
from subprocess import check_call
from subprocess import CalledProcessError
from MCTF_parser import MCTF_parser

file = ""
rate = 0.0
pictures = 33
pixels_in_x = 352
pixels_in_y = 288

parser = MCTF_parser(
    description="Expands the the HFB texture data using JPEG 2000.")
parser.add_argument(
    "--file",
    help="file that contains the LFB data. Default = {})".format(file))
parser.add_argument(
    "--rate",
    help=
    "read only the initial portion of the code-stream, corresponding to an overall bit-rate of \"rate\" bits/sample. Default = {})"
    .format(rate))
parser.pictures(pictures)
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)

args = parser.parse_known_args()[0]
if args.file:
    file = args.file
if args.rate:
    rate = float(args.rate)
from MCTF_parser import MCTF_parser

COMPONENTS = 3
BYTES_PER_COMPONENT = 1

file = ""
pictures = 33
pixels_in_x = 352
pixels_in_y = 288
quantizations = "45000"
subband = 1
SRLs = 5

parser = MCTF_parser(description="Compress the HFB texture data using JPEG 2000.")

parser.add_argument("--file", help="file that contains the HFB data. Default = {})".format(file))
parser.pictures(pictures)
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.quantizations(quantizations)
parser.add_argument("--subband", help="subband to compress. Default = {})".format(file))
parser.SRLs(SRLs)

args = parser.parse_known_args()[0]
if args.file:
    file = args.file
if args.pictures:
    pictures = int(args.pictures)
if args.pixels_in_x:
    pixels_in_x = int(args.pixels_in_x)
if args.pixels_in_y:
pictures            = 9
## Search range for motion vectors.
search_range        = 4
## Sub-pixel accuracy in motion estimate.
subpixel_accuracy   = 0
## Level update. For example, a value equal to 1/4 means that the high-frequency subband is 4 times less important than the low-frequency subband.
update_factor       = 0 # 1.0/4


## The parser module provides an interface to Python's internal parser and byte-code compiler.
parser = MCTF_parser(description="Performs a temporal analysis step.")
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.GOPs(GOPs)
parser.TRLs(TRLs)
parser.add_argument("--temporal_subband", help="iteration of the temporal transform.".format(temporal_subband))
parser.always_B(always_B)
parser.block_overlaping(block_overlaping)
parser.block_size(block_size)
parser.border_size(border_size)
parser.pictures(pictures)
parser.search_range(search_range)
parser.subpixel_accuracy(subpixel_accuracy)
parser.update_factor(update_factor)

## A script may only parse a few of the command-line arguments, passing the remaining arguments on to another script or program.
args = parser.parse_known_args()[0]
if args.pixels_in_x:
    pixels_in_x = int(args.pixels_in_x)
if args.pixels_in_y:
    pixels_in_y = int(args.pixels_in_y)
## Number of blocks in the X direction.
blocks_in_x = 0
## Number of blocks in the Y direction.
blocks_in_y = 0
## Number of pictures of a temporal resolution.
fields      = 0
## Name of the file with the motion fields.
file        = ""
# Number of discard level.
# discard_levels = 0

## The parser module provides an interface to Python's internal parser
#  and byte-code compiler.
parser = MCTF_parser(description="Expands the motion data using JPEG 2000.")
#parser.add_argument("--discard_levels", help="number of discard level. (Default = {})".format(discard_levels))
parser.add_argument("--blocks_in_x",     help="number of blocks in the X direction. (Default = {})".format(blocks_in_x))
parser.add_argument("--blocks_in_y",     help="number of blocks in the Y direction. (Default = {})".format(blocks_in_y))
parser.add_argument("--fields",          help="number of fields in to compress. (Default = {})".format(fields))
parser.add_argument("--file",            help="name of the file with the motion fields. (Default = {})".format(file))

## A script may only parse a few of the command-line arguments,
#  passing the remaining arguments on to another script or program.
args = parser.parse_known_args()[0]
#if args.discard_levels:
#    discard_levels = int(args.discard_levels)
if args.blocks_in_x:
    blocks_in_x = int(args.blocks_in_x)
if args.blocks_in_y:
    blocks_in_y = int(args.blocks_in_y)
if args.fields:
    fields = int(args.fields)
HIGH = "high_"
LOW = "low_"
COMPONENTS = 4

discard_TRLs=0
discard_SRLs_Tex=0
discard_SRLs_Mot=0
new_slope = 45000
GOPs = 1
TRLs = 3
SRLs = 5
FPS = 30
BRC = 99999999

parser = MCTF_parser(description="Transcode.")
parser.add_argument("--discard_TRLs",
                    help="number of discarded temporal resolution levels. (Default = {})".format(discard_TRLs))
parser.add_argument("--discard_SRLs_Tex",
                    help="number of discarded spatial resolution levels for textures. (Default = {})".format(discard_SRLs_Tex))
parser.add_argument("--discard_SRLs_Mot",
                    help="number of discarded spatial resolution levels for motions. (Default = {})".format(discard_SRLs_Mot))
parser.add_argument("--new_slope",
                    help="new slope. (Default = {})".format(new_slope))
parser.add_argument("--GOPs",
                    help="number of GOPs to process. (Default = {})".format(GOPs))
parser.add_argument("--TRLs",
                    help="number of iterations of the temporal transform + 1. (Default = {})".format(TRLs))
parser.add_argument("--BRC",
                    help="bit-rate control (kbps). (Default = {})".format(BRC))

args = parser.parse_known_args()[0]
if args.discard_TRLs:
from MCTF_parser import MCTF_parser

COMPONENTS          = 4
BYTES_PER_COMPONENT = 2
BITS_PER_COMPONENT  = BYTES_PER_COMPONENT * 8

file         = ""
blocks_in_x  = 0
blocks_in_y  = 0
fields       = 0
clayers      = 1
quantization = 45000
SRLs         = 5

parser = MCTF_parser(description="Compress the motion data using JPEG 2000.")
parser.add_argument("--blocks_in_x",   help="number of blocks in the X direction. (Default = {})".format(blocks_in_x))
parser.add_argument("--blocks_in_y",   help="number of blocks in the Y direction. (Default = {})".format(blocks_in_y))
parser.add_argument("--fields",        help="number of fields in to compress. (Default = {})".format(fields))
parser.add_argument("--quantization",  help="controls the quality level and the bit-rate of the code-stream. (Default = {})".format(quantization))
parser.add_argument("--clayers",       help="logarithm controls the quality level and the bit-rate of the code-stream. (Default = {})".format(clayers))
parser.add_argument("--file",          help="name of the file with the motion fields. (Default = {})".format(file))

args = parser.parse_known_args()[0]
if args.blocks_in_x:
    blocks_in_x = int(args.blocks_in_x)
if args.blocks_in_y:
    blocks_in_y = int(args.blocks_in_y)
if args.fields:
    fields = int(args.fields)
if args.clayers:
    clayers = str(args.clayers)
import sys
import math
from subprocess import check_call
from subprocess import CalledProcessError
from MCTF_parser import MCTF_parser

file = ""
rate = 0.0
pictures = 33
pixels_in_x = 352
pixels_in_y = 288
subband = 4 # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

parser = MCTF_parser(description="Expands the the LFB texture data using JPEG 2000.")
parser.add_argument("--file", help="file that contains the LFB data. Default = {})".format(file))
parser.add_argument("--rate", help="read only the initial portion of the code-stream, corresponding to an overall bit-rate of \"rate\" bits/sample. Default = {})".format(rate))
parser.pictures(pictures)
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)

args = parser.parse_known_args()[0]
if args.file:
    file = args.file
if args.rate:
    rate = float(args.rate)
if args.pictures:
    pictures = int(args.pictures)
if args.pixels_in_x:
    pixels_in_x = int(args.pixels_in_x)
if args.pixels_in_y:
示例#14
0
#  code-stream used for the motion vectors. Used only 1 because we
#  have seen that compress motion information with loss, is not
#  helpful.
clayers      = 1
## Vector quantization. Normally does not apply, since the motion
#  information is compressed without loss.
quantization = 45000
## Number of Spatial Resolution Levels. Normally it does not apply,
#  since the vectors are usually compress and decompress at the same
#  spatial resolution.
SRLs         = 5

## The parser module provides an interface to Python's internal parser
#  and byte-code compiler.
parser = MCTF_parser(description="Compress the motion data using JPEG 2000.")
parser.add_argument("--blocks_in_x",   help="number of blocks in the X direction. (Default = {})".format(blocks_in_x))
parser.add_argument("--blocks_in_y",   help="number of blocks in the Y direction. (Default = {})".format(blocks_in_y))
parser.add_argument("--fields",        help="number of fields in to compress. (Default = {})".format(fields))
parser.add_argument("--quantization",  help="controls the quality level and the bit-rate of the code-stream. (Default = {})".format(quantization))
parser.add_argument("--clayers",       help="logarithm controls the quality level and the bit-rate of the code-stream. (Default = {})".format(clayers))
parser.add_argument("--file",          help="name of the file with the motion fields. (Default = {})".format(file))

## A script may only parse a few of the command-line arguments,
#  passing the remaining arguments on to another script or program.
args = parser.parse_known_args()[0]
if args.blocks_in_x:
    blocks_in_x = int(args.blocks_in_x)
if args.blocks_in_y:
    blocks_in_y = int(args.blocks_in_y)
if args.fields:
    fields = int(args.fields)
示例#15
0
from subprocess import check_call
from subprocess import CalledProcessError
from MCTF_parser import MCTF_parser
HIGH = "high"
LOW = "low"

GOPs = 1
discarded_TRLs = 0
discarded_SRLs = 0
quantization = "45000"
TRLs = 6
GOPs = 1

parser = MCTF_parser(description="Transcodes a code-stream.")
parser.GOPs(GOPs)
parser.add_argument("--discarded_SRLs", help="number of discarded spatial resolution levels. Default = {}".format(discarded_parser.add_argument("--discarded_TRLs", help="number of discarded temporal resolution levels. Default = {}".format(discarded_TRLs))
SRLs))
parser.quantization(quantization)
parser.TRLs(TRLs)
parser.SRLs(SRLs)

args = parser.parse_known_args()[0]
if args.discarded_SRLs:
    discarded_SRLs = int(args.discarded_SRLs)
if args.discarded_TRLs:
    discarded_TRLs = int(args.discarded_TRLs)
if args.quantization:
    quantization = args.quantization
if args.SRLs:
    SRLs = int(args.SRLs)
if args.TRLs:
    TRLs = int(args.TRLs)
#!/usr/bin/python
# -*- coding: iso-8859-15 -*-

import sys
from subprocess import check_call
from subprocess import CalledProcessError
from MCTF_parser import MCTF_parser

file = ""

parser = MCTF_parser(description="Does nothing with the HFB texture data.")
parser.add_argument("--file", help="file that contains the LFB data. Default = {})".format(file))

args = parser.parse_known_args()[0]
if args.file:
    file = args.file

try:
    check_call("trace cp " + file + ".cp " + file, shell=True)
except CalledProcessError:
    sys.exit(-1)
#!/usr/bin/python
# -*- coding: iso-8859-15 -*-

import sys
from subprocess import check_call
from subprocess import CalledProcessError
from MCTF_parser import MCTF_parser

file = ""

parser = MCTF_parser(description="Does nothing with the HFB texture data.")
parser.add_argument(
    "--file",
    help="file that contains the LFB data. Default = {})".format(file))

args = parser.parse_known_args()[0]
if args.file:
    file = args.file

try:
    check_call("trace cp " + file + " " + file + ".cp", shell=True)
except CalledProcessError:
    sys.exit(-1)
示例#18
0
BYTES_PER_COMPONENT = 1

file = ""
pictures = 33
pixels_in_x = 352
pixels_in_y = 288
quantization = 45000
subband = 4  # meterla en parametros !!!!!!!!!!!!!!!!!
SRLs = 5
nLayers = 5

parser = MCTF_parser(
    description="Compress the LFB texture data using JPEG 2000.")

parser.add_argument(
    "--file",
    help="file that contains the LFB data. Default = {})".format(file))
parser.add_argument(
    "--nLayers",
    help=
    "Number of layers. Logarithm controls the quality level and the bit-rate of the code-stream. (Default = {})"
    .format(nLayers))
parser.pictures(pictures)
parser.pixels_in_x(pixels_in_x)
parser.pixels_in_y(pixels_in_y)
parser.quantization(quantization)
parser.SRLs(SRLs)

args = parser.parse_known_args()[0]
if args.file:
    file = args.file