Changeset a11a00
- Timestamp:
- 04/27/10 10:53:09 (3 years ago)
- Branches:
- b1faa09f4dfcf63d19d2cb9fc598a583e1df1c33
- Children:
- 649580
- Parents:
- 4025fc
- git-author:
- Dan Dennedy <dan@…> (04/27/10 10:53:09)
- git-committer:
- Dan Dennedy <dan@…> (04/27/10 10:53:09)
- File:
-
- 1 edited
-
src/filter/scale0tilt/scale0tilt.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/filter/scale0tilt/scale0tilt.c
rfb31c3 ra11a00 24 24 #include <string.h> 25 25 26 #define EPSILON 1e-6 27 26 28 typedef struct scale0tilt_instance { 27 29 double cl, ct, cr, cb; … … 32 34 gavl_video_frame_t* frame_src; 33 35 gavl_video_frame_t* frame_dst; 36 int do_scale; 34 37 } scale0tilt_instance_t; 35 38 … … 38 41 float dst_x, dst_y, dst_w, dst_h; 39 42 float src_x, src_y, src_w, src_h; 40 43 44 inst->do_scale = 1; 41 45 src_x = inst->w * inst->cl; 42 46 src_y = inst->h * inst->ct; … … 48 52 dst_w = inst->w * (1.0 - inst->cl - inst->cr) * inst->sx; 49 53 dst_h = inst->h * (1.0 - inst->ct - inst->cb) * inst->sy; 54 55 if((dst_w < EPSILON) || (dst_h < EPSILON) || 56 (src_w < EPSILON) || (src_h < EPSILON)) { 57 inst->do_scale = 0; 58 return; 59 } 50 60 51 61 if ( dst_x + dst_w > inst->w ) { … … 69 79 dst_y = 0; 70 80 } 81 82 if((dst_w < EPSILON) || (dst_h < EPSILON) || 83 (src_w < EPSILON) || (src_h < EPSILON)) { 84 inst->do_scale = 0; 85 return; 86 } 87 71 88 gavl_video_options_t* options = gavl_video_scaler_get_options( inst->video_scaler ); 72 89 … … 74 91 gavl_video_format_t format_dst; 75 92 76 memset(&format_src, 0, sizeof(format_src));77 memset(&format_dst, 0, sizeof(format_dst));93 memset(&format_src, 0, sizeof(format_src)); 94 memset(&format_dst, 0, sizeof(format_dst)); 78 95 79 96 format_dst.frame_width = inst->w; … … 275 292 outframe[i] = 0; 276 293 } 277 gavl_video_scaler_scale( inst->video_scaler, inst->frame_src, inst->frame_dst ); 278 } 279 294 if(inst->do_scale) 295 gavl_video_scaler_scale( inst->video_scaler, inst->frame_src, inst->frame_dst ); 296 } 297
Note: See TracChangeset
for help on using the changeset viewer.
