Skip to content

Commit

Permalink
Enabling processing of 4K
Browse files Browse the repository at this point in the history
  • Loading branch information
erikkaashoek committed Sep 16, 2019
1 parent 14dffb2 commit 755249b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
6 changes: 2 additions & 4 deletions comskip.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,8 @@ int width, old_width, videowidth;
int height, old_height;
int ar_width = 0;
int subsample_video = 0x1ff;
//#define MAXWIDTH 800
//#define MAXHEIGHT 600
#define MAXWIDTH 2000
#define MAXHEIGHT 1200
//#define MAXWIDTH 2000
//#define MAXHEIGHT 1200

char haslogo[MAXWIDTH*MAXHEIGHT];

Expand Down
5 changes: 4 additions & 1 deletion comskip.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#define COMSKIP
#endif
#ifdef _WIN32
#define PACKAGE_STRING " Comskip 0.82.007"
#define PACKAGE_STRING " Comskip 0.82.009"
#endif
#define _UNICODE

#define MAXWIDTH 4000
#define MAXHEIGHT 2400
10 changes: 6 additions & 4 deletions mpeg2dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

#include "platform.h"
#include "vo.h"
#include "comskip.h"

#ifdef HAVE_SDL
#include <SDL.h>
#endif
Expand Down Expand Up @@ -900,23 +902,23 @@ int SubmitFrame(AVStream *video_st, AVFrame *pFrame , double pts)
int changed = 0;

// bitrate = pFrame->bit_rate;
if (pFrame->linesize[0] > 2000 || pFrame->height > 1200 || pFrame->linesize[0] < 100 || pFrame->height < 100)
if (pFrame->linesize[0] > MAXWIDTH || pFrame->height > MAXHEIGHT || pFrame->linesize[0] < 100 || pFrame->height < 100)
{
// printf("Panic: illegal height, width or frame period\n");
frame_ptr = NULL;
return(0);
}
if (height != pFrame->height && pFrame->height > 100 && pFrame->height < 2000)
if (height != pFrame->height && pFrame->height > 100 && pFrame->height < MAXHEIGHT)
{
height= pFrame->height;
changed = 1;
}
if (width != pFrame->linesize[0] && pFrame->linesize[0] > 100 && pFrame->linesize[0] < 2000)
if (width != pFrame->linesize[0] && pFrame->linesize[0] > 100 && pFrame->linesize[0] < MAXWIDTH)
{
width= pFrame->linesize[0];
changed = 1;
}
if (videowidth != pFrame->width && pFrame->width > 100 && pFrame->width < 2000)
if (videowidth != pFrame->width && pFrame->width > 100 && pFrame->width < MAXWIDTH)
{
videowidth= pFrame->width;
changed = 1;
Expand Down
3 changes: 3 additions & 0 deletions platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
#include <limits.h>
#include <stdarg.h>
#include <ctype.h>
#else
#undef WINVER
#define WINVER _WIN32_WINNT_WIN7
#endif

#include <stdio.h>
Expand Down

0 comments on commit 755249b

Please sign in to comment.