コード例 #1
0
ファイル: avi_mjpeg.c プロジェクト: mgschwan/blensor
void *avi_converter_from_mjpeg(AviMovie *movie, int stream, unsigned char *buffer, size_t *size)
{
	int deint;
	unsigned char *buf;

	(void)stream; /* unused */

	buf = imb_alloc_pixels(movie->header->Height, movie->header->Width, 3, sizeof(unsigned char), "avi.avi_converter_from_mjpeg 1");
	if (!buf) {
		return NULL;
	}

	deint = Decode_JPEG(buffer, buf, movie->header->Width, movie->header->Height, *size);
	
	MEM_freeN(buffer);
	
	if (deint) {
		buffer = imb_alloc_pixels(movie->header->Height, movie->header->Width, 3, sizeof(unsigned char), "avi.avi_converter_from_mjpeg 2");
		if (buffer) {
			interlace(buffer, buf, movie->header->Width, movie->header->Height);
		}
		MEM_freeN(buf);
	
		buf = buffer;
	}
		
	return buf;
}
コード例 #2
0
/*
	This filter darkens even scanlines at 75%, 50%, 25% or 0% of their
	original intensity.

	Author: Raphael Assenat

*/
int Apply(int mode, SDL_v4l_image *image)
{
	int len=image->len;
	int i;


	if (mode == 0) return 0;

	if (status==1) { Apply_3_4(mode, image); }
	if (status==2) { Apply_1_2(mode, image); }
	if (status==3) { Apply_1_4(mode, image); }
	if (status==4) { Apply_0(mode, image); }
	if (status==5) { interlace(mode, image); }

	return 0;
}
コード例 #3
0
int main()
{
	_LLNode *Head = makeNode(1);
	int i = 0;
	for(i=2; i<5; i++) insert(&Head,i);
	Head = reverse(Head);
	print(Head);

	_LLNode *p2 = cutInHalf(Head);
	p2 = reverse(p2);
	print(Head); print(p2);
	interlace(Head,&p2);
	print(Head);
	print(p2);
	LLFree(Head);
	LLFree(p2);
	return 1;
}
コード例 #4
0
ファイル: mjpeg.c プロジェクト: jinjoh/NOOR
void *avi_converter_from_mjpeg (AviMovie *movie, int stream, unsigned char *buffer, int *size) {
	int deint;
	unsigned char *buf;
		
	buf= MEM_mallocN (movie->header->Height * movie->header->Width * 3, "avi.avi_converter_from_mjpeg 1");

	deint= check_and_decode_jpeg(buffer, buf, movie->header->Width, movie->header->Height, *size);
	
	MEM_freeN(buffer);
	
	if (deint) {
		buffer = MEM_mallocN (movie->header->Height * movie->header->Width * 3, "avi.avi_converter_from_mjpeg 2");
		interlace (buffer, buf, movie->header->Width, movie->header->Height);
		MEM_freeN (buf);
	
		buf= buffer;
	}
		
	return buf;
}
コード例 #5
0
ファイル: ysSource.C プロジェクト: AquaSoftGmbH/mjpeg
void ysSource::parse_keyword(char *optarg)
{
  
  if (!strncasecmp(optarg, "ACTIVE=", 7)) {
    if (_active_region.parse_geometry(optarg+7)) {
      mjpeg_error_exit1("Bad ACTIVE keyword: '%s'", optarg);
    }

  } else if (!strncasecmp(optarg, "MATTE=", 6)) {
    if (_matte_region.parse_geometry(optarg+6)) {
      mjpeg_error_exit1("Bad MATTE keyword: '%s'", optarg);
    }

  } else if (!strncasecmp(optarg, "BG=", 3)) {
    bgcolor(ysYCbCr::parse_string(optarg+3));

  } else if (!strcasecmp(optarg, "NORM=NTSC")) {
    norm(NORM_NTSC);

  } else if (!strcasecmp(optarg, "NORM=PAL")) {
    norm(NORM_PAL);

  } else if (!strcasecmp(optarg, "NORM=SECAM")) {
    norm(NORM_PAL);

  } else if (!strncasecmp(optarg, "CHROMASS=", 9)) {
    //    if (_stream.subsampling().parse_mode(optarg+9)) {
    if (_stream.subsampling().is_known()) {
      mjpeg_warn("Overriding source's chroma subsampling mode!");
      //  Was %s",
      //                 _stream.subsampling().mode_to_string());
    }
    if (_stream.parse_subsampling(optarg+9)) {
      mjpeg_error_exit1("Bad chroma subsampling spec: '%s'", optarg);
    }

  } else if (!strncasecmp(optarg, "ILACE=", 6)) {
    if (!strcasecmp(optarg+6, "TOP_FIRST")) {
      interlace(Y4M_ILACE_TOP_FIRST);
    } else if (!strcasecmp(optarg+6, "BOTTOM_FIRST")) {
      interlace(Y4M_ILACE_BOTTOM_FIRST);
    } else if (!strcasecmp(optarg+6, "NONE")) {
      interlace(Y4M_ILACE_NONE);
    } else if (!strcasecmp(optarg+6, "TOP_ONLY")) {
      fake_progressive(FAKE_TOP_ONLY);
    } else if (!strcasecmp(optarg+6, "BOTTOM_ONLY")) {
      fake_progressive(FAKE_BOT_ONLY);
    } else {
      mjpeg_error_exit1("Bad interlace spec: '%s'", optarg);
    }

  } else if (!strncasecmp(optarg, "SAR=", 4)) {
    ysRatio sar;
    if (!strcasecmp(optarg+4, "NTSC")) {
      sar = y4m_sar_NTSC_CCIR601;
    } else if (!strcasecmp(optarg+4, "PAL")) {
      sar = y4m_sar_PAL_CCIR601;
    } else if (!strcasecmp(optarg+4, "NTSC_WIDE")) {
      sar = y4m_sar_NTSC_16_9;
    } else if (!strcasecmp(optarg+4, "PAL_WIDE")) {
      sar = y4m_sar_PAL_16_9;
    } else if (sar.parse_ratio(optarg+4)) {
      mjpeg_error_exit1("Bad ratio spec: '%s'", optarg);
    }
    _stream.sar(sar);

  } else
    mjpeg_error_exit1 ("Unrecognized input parameter:  '%s'", optarg);
}