/*
* Copyright 2005 by the Massachusetts Institute of Technology.
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
* fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in
* advertising or publicity pertaining to distribution of the
* software without specific, written prior permission.
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is"
* without express or implied warranty.
*/
/**
* @description
* This file contains functions that allow one to decode MPEG-2 compliant video.
* The code is based on the MPEG-2 specification (ISO/IEC 13818-2). The MPEG-2 decoding
* is a work in progress, although it works within a limited test range. Throughout the
* source code, citations are made in cases where an understanding of the code would be
* helped by looking at an outside source. The format I have chosen is
* (cite NUM#, LOOKUP_INFO). NUM=1 refers to ISO/IEC: 13818-2, and NUM=2 refers to the reference
* MPEG implementation written in C, available at [www.mpeg.org].
*
* @author Matthew Drake
* @file ColorChannelProcessing_opt_splitjoin.str
* @version 1.0
*/
// replacement code: wrap if around adds of separately-defined splitjoin's
int->int pipeline ColorChannelProcessing(int width,
int height,
portal UpdatePortal_picture_type,
int the_chroma_format,
portal UpdatePortal_picture_type3) {
if (the_chroma_format == 1) {
add LumChromFormatOne(width,
height,
UpdatePortal_picture_type,
the_chroma_format,
UpdatePortal_picture_type3);
} else {
add LumChromFormatOther(width,
height,
UpdatePortal_picture_type,
the_chroma_format,
UpdatePortal_picture_type3);
}
}
// splitjoin pulled out above
int->int splitjoin LumChromFormatOne(int width,
int height,
portal UpdatePortal_picture_type,
int the_chroma_format,
portal UpdatePortal_picture_type3) {
split roundrobin(4*75, 2*75);
add LuminanceChannelProcessing(width,
height,
UpdatePortal_picture_type,
the_chroma_format,
UpdatePortal_picture_type3);
add int->int splitjoin {
split roundrobin(75);
add ChrominanceChannelProcessing(width,
height,
UpdatePortal_picture_type,
the_chroma_format,
UpdatePortal_picture_type3);
add ChrominanceChannelProcessing(width,
height,
UpdatePortal_picture_type,
the_chroma_format,
UpdatePortal_picture_type3);
join roundrobin(1, 1);
}
join roundrobin(1, 2);
}
// splitjoin pulled out above
int->int splitjoin LumChromFormatOther(int width,
int height,
portal UpdatePortal_picture_type,
int the_chroma_format,
portal UpdatePortal_picture_type3) {
split roundrobin(4*75, 4*75);
add LuminanceChannelProcessing(width,
height,
UpdatePortal_picture_type,
the_chroma_format,
UpdatePortal_picture_type3);
add int->int splitjoin {
split roundrobin(75);
add ChrominanceChannelProcessing(width,
height,
UpdatePortal_picture_type,
the_chroma_format,
UpdatePortal_picture_type3);
add ChrominanceChannelProcessing(width,
height,
UpdatePortal_picture_type,
the_chroma_format,
UpdatePortal_picture_type3);
join roundrobin(1, 1);
}
join roundrobin(1, 2);
}