supplierdeeply

IXUS 1000 HS Porting Thread

  • 418 Replies
  • 48768 Views
  • Publish
    Re: IXUS 1000 HS Porting Thread
    « Reply #240 on: 05 / January / 2011, 06:34:38 »
    Advertisements
    To avoid floating point math ...

    On my VxWorks A620, I can use floating point in computations and as a format specifier in sprintf().

    Can you do this on SX30, G12 or IXUS 1000 HS ?


    David

  • Publish
    Re: IXUS 1000 HS Porting Thread
    « Reply #241 on: 05 / January / 2011, 10:16:47 »
    thanks philmoz i understand now more what to do.
    can you tell a label i should search for, maybe i find the table of zoom in IX1000 too ?

    I think float useage is more easy, i dont know how often /sec is this value calc.
    if this is only calc 50 times /sec then there is no slowdown on faster ARM CPU.

    use a dvision of 1000 in integer is too slow.because division need 20-30 clock cycles.better use 1024 this can do by a shift command in 1 clock cycle.

    when use float you can avoid the lots division extra cycles by *(1/1000) for example

    but its too hard for me(i need too much testbuilds i think) to change the integer formula so it work ok in float
    Ixus 1000 HS

    *

    Offline philmoz

    • *****
    • 2936
      • Photos
  • Publish
    Re: IXUS 1000 HS Porting Thread
    « Reply #242 on: 05 / January / 2011, 14:03:18 »

    I think float useage is more easy, i dont know how often /sec is this value calc.
    if this is only calc 50 times /sec then there is no slowdown on faster ARM CPU.

    use a dvision of 1000 in integer is too slow.because division need 20-30 clock cycles.better use 1024 this can do by a shift command in 1 clock cycle.


    I doubt any of the cameras have a floating point co-processor (I could be wrong) so using floating point math will be 100's of times slower as it will have to be done in a math library.

    If you want to use 1024 as the divisor then set CF_EFL to 5852 = (360/63)*1024 rounded up.

    Phil.
    CHDK ports:
      sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
      g12 (1.00c, 1.00e, 1.00f & 1.00g)
      sx130is (1.01d & 1.01f)
      ixus310hs (1.00a & 1.01a)
      sx40hs (1.00d, 1.00g & 1.00i)
      g1x (1.00e, 1.00f & 1.00g)

    *

    Offline philmoz

    • *****
    • 2936
      • Photos
  • Publish
    Re: IXUS 1000 HS Porting Thread
    « Reply #243 on: 05 / January / 2011, 16:10:51 »
    can you tell a label i should search for, maybe i find the table of zoom in IX1000 too ?

    I took a guess that there would be a focal length table somewhere in the firmware and that it would store the focal lengths multiplied by some constant and stored as integers (rather than using floating point).

    The longest focal length on the SX30 is 150.5mm, assuming the multiplier is 1000 means this would be stored as 150,500, or 0x24BE4.

    I searched the firmware for the byte sequence E4 4B 02 00 (little endian so low order byte is first).
    I found this sequence so then I search backwards for the shortest focal length (4.3mm, 4300 = 0x10cc).
    I found this value 201 words before the longest value and all the values in between were ascending - so it was a safe bet this was the focus length table .

    I found a similiar table on the G12; but in this case each entry in the table is actually 3 words long with the first word of each entry being the focal length (not sure what the other two are).

    Hope this helps,
    Phil.
    CHDK ports:
      sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
      g12 (1.00c, 1.00e, 1.00f & 1.00g)
      sx130is (1.01d & 1.01f)
      ixus310hs (1.00a & 1.01a)
      sx40hs (1.00d, 1.00g & 1.00i)
      g1x (1.00e, 1.00f & 1.00g)


  • Publish
    Re: IXUS 1000 HS Porting Thread
    « Reply #244 on: 09 / January / 2011, 14:19:31 »
    I add in main.c this values and the zoom Factor is show correct now.

    is it ok to only use 2 entries ?

    6.3 is min zoom *1000 = 6300
    63 is max zoom *1000 = 63000

    static const struct {
       int zp, fl;
    } fl_tbl[] = {
      {   0,   6300},
      { 100,  63000},
    };
    #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0]))


    // Focal length range is 5.0 - 70,0 mm, 27.3 - 392 in 35-mm equivalent.
    // So, CF_EFL = 27.3/5.0*10000=54600 or392/70*10000=56000
    // diff = 54600 - 54566.6 = 1400, split it 1400 / 2 = 700
    // add to base 56000 + 700 = 56700
    // divide by 10 to avoid overflow in get_effective_focal_length()
    #define CF_EFL  5714

    const int zoom_points = 100;

    @asm1989

    maybe its possible that copy the files to main trunk ?
    I dont know what else is need

    copy platform files and merge ix1000 in camera.h or need more do ?

    I use in camera.h now the propset4 in trunk.this work good in IX1000

    only the zebra do not work in 4:3

    I need

    int vid_get_viewport_width() { return 480; }

    360 do not work


    I see in G12 there is no zebra_nobuff set, but in SX30 it is.
    have G12 more ram so the 240 kb of buffer are here ?

    I test

    viewport_xoffset = 60; //vid_get_viewport_xoffset();

    viewport_yoffset = 40;//vid_get_viewport_yoffset();

    but it does not shift the zebra position, only happen that on positions below no zebra is show

    I dont know whats wrong, maybe need a buffer for this ?

    I do also this, but no shift.I dont understand that a y offset is need.on IX 1000 in y image have always full height.Is that on G12 and SX 30 diffrent ?

    int vid_get_viewport_yoffset()
    {
       if (shooting_get_prop(PROPCASE_ASPECT_RATIO) == 1)   // Wide screen top & bottom 30 pixels not used in viewport
          return 30;
       return 0;
    }

    int vid_get_viewport_xoffset()
    {
       if (shooting_get_prop(PROPCASE_ASPECT_RATIO) == 1)   // Wide screen top & bottom 30 pixels not used in viewport
          return 0;
       return 60;
    }
    « Last Edit: 09 / January / 2011, 14:26:01 by Bernd R »
    Ixus 1000 HS

  • Publish
    Re: IXUS 1000 HS Porting Thread
    « Reply #245 on: 10 / January / 2011, 13:51:40 »
    I have now the aperture size table change.

    But i see in firework mode, on max zoom values are 601 and 9.But other camera have only 8.
    Is it better to not support 9 too then ?

    const ApertureSize aperture_sizes_table[] = {
       {  9, 346, "3.4" },
        { 10, 352, "3.5" },
       { 11, 384, "4.0" },
       { 12, 416, "4.5" },
       { 13, 448, "5.0" },
       { 14, 476, "5.6" },
       { 15, 512, "6.3" },
       { 16, 544, "7.1" },
       { 17, 576, "8.0" },
       { 18, 600, "9.0" }    // is show on fireworks mode max zoom
    };

    ---------------------------------

    I test overwrite ISO function.I set to 10 and factor 10
    Now chdk show on top in red ISO 100.I use auto in Canon Mode.

    when i focus the canon calue show ISO 1600.I am indoor.
    the chdk value I-M show around 100

    when i shoot 1. picture brightness is ok, but it seem still ISO 1600.
    now when i do second shoot, the image is very dark.
    so seem set to ISO 100, but the tv time is not change.i verify time table to other cam, IX1000 seem same here
    the image viewer still show ISO 1600

    I also test Auto iso.Its show in red that it is on.I limit to ISO 500

    on focus I-M show around 500 now and Canon ISO show 1600
    picture are correct bright and when i look in viewer i see same tv value and iso as a normal shoot at ISO 1600

    do i miss something ?

    the show of ISO value seem ok, because when i disable all chdk iso overwerites in chdk menu, I-M show same as Canon ISO value
    « Last Edit: 10 / January / 2011, 13:56:11 by Bernd R »
    Ixus 1000 HS

    *

    Offline asm1989

    • *****
    • 527
    • SX720, SX260, SX210 & SX200
  • Publish
    Re: IXUS 1000 HS Porting Thread
    « Reply #246 on: 13 / January / 2011, 13:56:12 »
    @bernrd
    ->the new keyb seams to work
    Code: [Select]
    DEF(physw_status, 0x34408)                 // Found at: FF834B8C   kbd_read_keys
    ->Also the videorecord can be used to get into alt,  but I may have wrong the menu

    These are my numbers:

    Code: [Select]
    ->[1]

    IDDLE - fffdf  - 11111111111111011111

    RIGHT  -fb7df-   11111011011111011111
                            00000100100000000000   -4800

    LEFT  -  b5fdf - 10110101111111011111
                          01001010000000000000   -4A000
                    
    UP - bdbdf  -    10111101101111011111
                           01000010010000000000   -42400

    DOWN -5bfdf  -    1011011111111011111
                            10100100000000000000  -A4000

    func -fefdf  -   11111110111111011111
                         00000001000000000000  -1000

    zoomup -fffd7 -  11111111111111010111
                            00000000000000001000  - 8

    zoomdw -fffdd -  11111111111111011101
                            00000000000000000010  - 2

    menu  - 3ffdf -    111111111111011111
                         11000000000000000000  - C0000

    print - fff5f -  11111111111101011111
                        00000000000010000000  -80

                     00000100100000000000   -4800
                     01001010000000000000   -4A000
                     01000010010000000000   -42400
                     10100100000000000000  -A4000
                     00000001000000000000  -1000
    00000000000000001000  - 8
                     00000000000000000010  - 2
                     11000000000000000000  - C0000
    00000000000010000000  -80

    11101111110010001010  -Mask-EFC8A

    ->[2]

    IDDLE - a10b   -   1010000100001011

    SHOTFULL - 8109  - 1000000100001001
                                 0010000000000010   - 2002

    SHOTHALF - 810b  - 1000000100001011
                                 0010000000000000  - 2000

                       0010000000000010   - 2002  -> MASK
                       0010000000000000  - 2000    
    « Last Edit: 13 / January / 2011, 13:59:56 by asm1989 »

  • Publish
    Re: IXUS 1000 HS Porting Thread
    « Reply #247 on: 13 / January / 2011, 14:18:00 »
    thanks, i have currently test that values and its test ok when ok stand behind.
    video button as alt button, work now too.

    i only need check shoot full and zoom in and zoom out if that work and correct mask values.i have this for block all keys, but i think i need sub the USB and writeprotect bit and the bits that are used for mode switch.

    #define KEYS_MASK1 (0x000FFFFF)
    #define KEYS_MASK2 (0x00000000)  // physw_status[2]

    static KeyMap keymap[] = {

       { 2, KEY_SHOOT_FULL   , 0x00000002 },  //  
            { 2, KEY_SHOOT_HALF   , 0x00002000 },  //  ok
       { 1, KEY_UP               , 0x00000400 },  // ok
       { 1, KEY_DOWN           , 0x00020000 },  // ok
       { 1, KEY_LEFT           , 0x00008000 },  // ok
       { 1, KEY_RIGHT           , 0x00000800 },  // ok
    //   { 1, KEY_UP_SOFT         , 0x00000400 },  //
    //   { 1, KEY_DOWN_SOFT        , 0x00000800 },  //
    //   { 1, KEY_LEFT_SOFT        , 0x00001000 },  //
    //   { 1, KEY_RIGHT_SOFT        , 0x00002000 },  //
       { 1, KEY_SET           , 0x00001000 },  // ok
    //   { 1, KEY_ZOOM_IN_FASTER  , 0x00000008 },  //
    //   { 1, KEY_ZOOM_OUT_FASTER , 0x00000002 },  //
       { 1, KEY_ZOOM_IN         , 0x00000008 },  //
       { 1, KEY_ZOOM_OUT        , 0x00000002 },  //
       { 1, KEY_MENU           , 0x00010000 },  // ok
       { 1, KEY_PRINT           , 0x00000080 },  // ok video key
            { 0, 0, 0 }
    };
    « Last Edit: 13 / January / 2011, 14:20:02 by Bernd R »
    Ixus 1000 HS


  • Publish
    Re: IXUS 1000 HS Porting Thread
    « Reply #248 on: 14 / January / 2011, 09:26:44 »
    Here i have upload working keyboard.please look on it, if the mask is ok

    http://www.zshare.net/download/852184786c494dba/

    as far i understand all bits of keys need set, when alt mode is on due a mask

    So i add this mask

    #define KEYS_MASK1 (0x400 | 0x20000 | 0x8000 | 0x800 | 0x1000 | 0x8 | 0x2 |0x10000 |0x80)
    #define KEYS_MASK2 (0x00002002)  // physw_status[2]
    Ixus 1000 HS

    *

    Offline asm1989

    • *****
    • 527
    • SX720, SX260, SX210 & SX200
  • Publish
    Re: IXUS 1000 HS Porting Thread
    « Reply #249 on: 16 / January / 2011, 12:20:23 »
    @Bernrd
    looks like works with these numbers

     

    Related Topics